Class: DefCoordSystem

algeobra~DefCoordSystem(paramsopt)

Definition of a coordinate system Coordinte systems may be placed relative to other coordinate systems. They are specified by two local axes and a local origin. When computing the value, the final coordinates of origin and axes will be in the same coordinate frame as the parent. Thus, in general, the result will be in world coordinates, as each parent, will itself be specified in its parent's system, until there is a system with no parent (implicit world coordinates) This makes it easy to define vectors and points locally, with DefCoordSystemOps and still use those resulting vectors together with arbitrary other ones, without the issue if different coordinate frames

Constructor

new DefCoordSystem(paramsopt)

Default values
Parameters:
Name Type Attributes Description
params Object <optional>
Properties
Name Type Attributes Description
local Object <optional>
The local coordinate system
prent Object <optional>
The parent coordinate system
Source:

Methods

compute(info) → {Object}

Computes the coordinate system
Parameters:
Name Type Description
info CreateInfo The creation info
Source:
Returns:
An object of type TYPE_COORD_SYSTEM
Type
Object

(static) computeContravariantBasis(u, v) → {Object}

Computes the contravariant basis for a given basis As the basis vectors are not required to be normalized or orthogonal, the contravariant basis can be used to determine the coordinates of a vector in the given basis
Parameters:
Name Type Description
u Object The first axis
v Object The second axis
Source:
Returns:
The contravariant basis vectors
Type
Object

(static) createSystem(paramsopt) → {Object}

Creates a coordinate system structure for the given parameters If origin is not given, it defaults to the usual (0,0) If u is not given, it defaults to the usual x-axis (1,0) If v is not given, it defaults to the normal vector to u.
Parameters:
Name Type Attributes Description
params Object <optional>
Properties
Name Type Attributes Description
origin Object <optional>
The origin
u Object <optional>
The first axis
v Object <optional>
The second axis
Source:
Returns:
Type
Object

(static) fromContravariant(system, parentopt) → {CreateInfo}

Creates a coordinate system that consist of the same origin but the contravarint base vectors as the given system
Parameters:
Name Type Attributes Description
system Number | Object Either the index or value of a TYPE_COORD_SYSTEM. The system which this one is based on
parent Number | Object <optional>
Either the index or value of a TYPE_COORD_SYSTEM. The parent coordinate system
Source:
Returns:
The creation info
Type
CreateInfo

(static) fromTransform(paramsopt, defaultValuesopt) → {CreateInfo}

Creates a coordinate system by specifying a transformation of the local axes
Parameters:
Name Type Attributes Description
params Object <optional>
Properties
Name Type Attributes Description
translation Number | Object <optional>
Either the index or value of a TYPE_VECTOR. The translation of the origin
rotation Number | Object <optional>
Either the index or value of a TYPE_NUMBER. The rotation angle of the first axis
scale Number | Object <optional>
Either the index or value of either type TYPE_VECTOR or TYPE_NUMBER. The scaling factor
parent Number | Object <optional>
Either the index or value of a TYPE_COORD_SYSTEM. The parent coordinate system
defaultValues Object <optional>
Properties
Name Type Attributes Description
translation Object <optional>
Default value for the translation
rotation Number <optional>
Default value for the rotation angle
scale Number | Object <optional>
Default value for the scale
Source:
Returns:
The creation info
Type
CreateInfo

(static) fromValues(paramsopt) → {CreateInfo}

Creates a coordinate system by specifying local origin and axes If the first axis (u) is given, the second default value will be overriden by the given second axis (v) as well, even if that is empty. That means, if u is not given, v will also be set to empty and used the default values, if they are set. If v is empty, it will be computed as the normal to u. When not given any values, the defaults are the usual coordinate axies with origin (0,0) and u = (1,0), v = (0,1)
Parameters:
Name Type Attributes Description
params Object <optional>
Properties
Name Type Attributes Description
origin Number | Object <optional>
Either the index or value of a TYPE_POINT. The local origin
u Number | Object <optional>
Either the index or value of a TYPE_VECTOR. The first axis
v Number | Object <optional>
Either the index or value of a TYPE_VECTOR. The second axis
parent Number | Object <optional>
Either the index or value of a TYPE_COORD_SYSTEM. The parent coordinate system
Source:
Returns:
The creation info
Type
CreateInfo

(static) isRightHanded(u, v)

Computes, whether a coordinate system is right-handed
Parameters:
Name Type Description
u Object The first axis
v Object The second axis
Source:
Returns:
True, if the coordinate system is right-handed, otherwise false

(static) pointFromCoordSystem(coords, coordSystem) → {Object}

Computes the world coordinates of a point specified in the local coordinates
Parameters:
Name Type Description
coords Object The local coordintaes
coordSystem Object
Properties
Name Type Description
origin Object The origin
u Object The first axis
v Object The second axis
Source:
Returns:
The world point
Type
Object

(static) vectorFromCoordSystem(coords, coordSystem) → {Object}

Computes the world coordinates of a vector specified in the local coordinates As a vector has no position, this just depends on the axes
Parameters:
Name Type Description
coords Object The local coordintaes
coordSystem Object
Properties
Name Type Description
u Object The first axis
v Object The second axis
Source:
Returns:
The world vector
Type
Object