Module geometry

A module providing basic functions for vector and coordinate operations.

Description

A module providing basic functions for vector and coordinate operations.

The include file "geometry.hrl" provides the definition of the records #vector{} and #speric{}, to represent coordinates and vectors (see below) and some macros, used to define colors, vectors and real measurement units. The following macros are available:

Data Types

spheric()

spheric() = #spheric{}

A record representing spheric coordinates. It has the fields:

vector()

vector() = #vector{}

A record representing a vector (or a point) in 3D space and has the fields x, y and z.

Function Index

add/2Adds two vectors.
angle/2Determines the angle (in degrees) formed by two vectors.
cartesian2spheric/1Converts coordinates from cartesian to spheric.
cross/2Vector cross product.
distance/2Compute the distance between the targets of by two vectors.
dot/2Vector dot product.
dot_v/2Multiplies a scalar with a vector.
norm/1Computes the length of a vector.
normalize_angle/1Normalizes an angle (in degrees) in the range -180, 180.
spheric2cartesian/1Converts coordinates from spheric to cartesian.
to_degrees/1Coverts an angle from radiants to degree.
to_radiants/1Coverts an angle from degree to radiants.

Function Details

add/2

add(V1::vector(), V2::vector()) -> vector()

Adds two vectors.

angle/2

angle(V1::vector(), V2::vector()) -> number()

Determines the angle (in degrees) formed by two vectors.

cartesian2spheric/1

cartesian2spheric(V::vector()) -> spheric()

Converts coordinates from cartesian to spheric.

cross/2

cross(V1::vector(), V2::vector()) -> number()

Vector cross product.

distance/2

distance(V1::vector(), V2::vector()) -> number()

Compute the distance between the targets of by two vectors.

dot/2

dot(V1::vector(), V2::vector()) -> number()

Vector dot product.

dot_v/2

dot_v(A::number(), V::vector()) -> vector()

Multiplies a scalar with a vector.

norm/1

norm(V::vector()) -> number()

Computes the length of a vector.

normalize_angle/1

normalize_angle(Angle::number()) -> number()

Normalizes an angle (in degrees) in the range -180, 180.

spheric2cartesian/1

spheric2cartesian(S::spheric()) -> vector()

Converts coordinates from spheric to cartesian.

to_degrees/1

to_degrees(Angle::number()) -> number()

Coverts an angle from radiants to degree.

to_radiants/1

to_radiants(Angle::number()) -> number()

Coverts an angle from degree to radiants.


Generated by EDoc, Nov 21 2007, 10:13:23.