jord-2.0.0.0: Geographical Position Calculations

Copyright(c) 2020 Cedric Liegeois
LicenseBSD3
MaintainerCedric Liegeois <ofmooseandmen@yahoo.fr>
Stabilityexperimental
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010

Data.Geo.Jord.Math3d

Description

3-element vector and associated math functions.

Synopsis

Documentation

data V3 Source #

3-element vector.

Instances
Eq V3 Source # 
Instance details

Defined in Data.Geo.Jord.Math3d

Methods

(==) :: V3 -> V3 -> Bool #

(/=) :: V3 -> V3 -> Bool #

Show V3 Source # 
Instance details

Defined in Data.Geo.Jord.Math3d

Methods

showsPrec :: Int -> V3 -> ShowS #

show :: V3 -> String #

showList :: [V3] -> ShowS #

v3x :: V3 -> Double Source #

x-coordinate

v3y :: V3 -> Double Source #

y-coordinate

v3z :: V3 -> Double Source #

z-coordinate

vec3 :: Double -> Double -> Double -> V3 Source #

Vector 3d from given coordinates. 0.0 is added to each component to avoid -0.0.

add :: V3 -> V3 -> V3 Source #

Adds 2 vectors.

subtract :: V3 -> V3 -> V3 Source #

Subtracts 2 vectors.

squaredDistance :: V3 -> V3 -> Double Source #

Computes the square of the straight line distance (or geometrical distance) between 2 vectors.

dot :: V3 -> V3 -> Double Source #

Computes the dot product of 2 vectors.

norm :: V3 -> Double Source #

Computes the norm of a vector.

cross :: V3 -> V3 -> V3 Source #

Computes the cross product of 2 vectors: the vector perpendicular to given vectors.

scale :: V3 -> Double -> V3 Source #

scale v s multiplies each component of v by s.

unit :: V3 -> V3 Source #

Normalises a vector. The norm of the produced vector is 1.

zero :: V3 Source #

vector of norm 0.

transposeM :: [V3] -> [V3] Source #

transpose square (3x3) matrix of V3.

dotM :: [V3] -> [V3] -> [V3] Source #

multiplies 2 3x3 matrices.

multM :: V3 -> [V3] -> V3 Source #

Multiplies vector by 3x3 matrix (rows).