collada-types-0.3: Data exchange between graphic applications

Graphics.Formats.Collada.Vector2D3D

Synopsis

Documentation

type Angle = FloatSource

An angle is a number between -pi and pi.

data V2 Source

2D vector: a pair of coordinates.

Constructors

V !Float !Float 

Instances

data V3 Source

Constructors

V3 !Float !Float !Float 

Instances

data V4 Source

Constructors

V4 !Float !Float !Float !Float 

Instances

data T2 Source

2D affine transformation. No shearing allowed, only translation, rotation, and scaling. Transformations can be chained with mappend, and mempty is the identity transformation.

Instances

unit :: Angle -> V2Source

Unit vector with the given direction.

(*.) :: V2 -> Float -> V2Source

Multiplication with a scalar.

dot :: V2 -> V2 -> FloatSource

Multiplication with a scalar.

Division by a scalar.

Dot product.

dot3 :: V3 -> V3 -> FloatSource

Dot product.

cross :: V2 -> V2 -> FloatSource

Perp-dot product (2D cross product).

cross3 :: V3 -> V3 -> V3Source

3D cross product.

perpL :: V2 -> V2Source

Vector rotated 90 degrees leftwards.

perpR :: V2 -> V2Source

Vector rotated 90 degrees rightwards.

mul :: V3 -> Float -> V3Source

turn :: V2 -> V2 -> OrderingSource

Relative direction of two vectors: turn v1 v2 equals GT if v2 takes a left turn with respect to v1, LT if it is a right turn, and EQ if they are parallel.

turnL :: V2 -> V2 -> BoolSource

turnL v1 v2 == (turn v1 v2 == GT)

turnNL :: V2 -> V2 -> BoolSource

turnNL v1 v2 == (turn v1 v2 /= GT)

turnR :: V2 -> V2 -> BoolSource

turnR v1 v2 == (turn v1 v2 == LT)

turnNR :: V2 -> V2 -> BoolSource

turnNR v1 v2 == (turn v1 v2 /= LT)

parv :: V2 -> V2 -> BoolSource

parv v1 v2 == (turn v1 v2 == EQ)

square :: V2 -> FloatSource

Vector length squared.

mag :: V2 -> FloatSource

Vector length.

norm :: V2 -> V2Source

Vector normalisation.

dir :: V2 -> AngleSource

3d Vector length.

Set Vector length.

The angle of a vector with respect to the X axis.

inverse :: T2 -> T2Source

Inverse transformation

(<>) :: T2 -> V2 -> V2Source

Transformation applied to a vector.

translate :: V2 -> T2Source

Transformation representing a translation.

rotate :: Angle -> T2Source

Transformation representing a rotation.

scale :: Float -> T2Source

Transformation representing a scaling.

translationOf :: T2 -> V2Source

The translation factor of a transformation.

rotationOf :: T2 -> AngleSource

The rotation factor of a transformation.

scaleOf :: T2 -> FloatSource

The scaling factor of a transformation.

withTranslation :: T2 -> V2 -> T2Source

Replacing the translation factor of a transformation.

withRotation :: T2 -> Angle -> T2Source

Replacing the rotation factor of a transformation.

withScale :: T2 -> Float -> T2Source

Replacing the scaling factor of a transformation.