gjk-0.0.0.2: Gilbert-Johnson-Keerthi (GJK) collision detection algorithm

Safe HaskellSafe
LanguageHaskell2010

GJK.Point

Description

Point

Synopsis

Documentation

type Pt = (Double, Double) Source #

Simple alias for a two dimentional point

dot :: Pt -> Pt -> Double Source #

Dot product of given points

sub :: Pt -> Pt -> Pt Source #

Subtract a from b

from :: Pt -> Pt -> Pt Source #

Alias for sub - reads better in some cases - as in "from a to b"

add :: Pt -> Pt -> Pt Source #

Add a and b

mul :: Double -> Pt -> Pt Source #

Multiply x and y with n

neg :: Pt -> Pt Source #

Negation

cross2D :: Pt -> Pt -> Double Source #

2D cross product

trip :: Pt -> Pt -> Pt -> Pt Source #

Implements a x (b x c) = b(a.c) - c(a.b)

perp :: Pt -> Pt -> Pt Source #

Perpendicular to a in direction of b (2D case)

isSameDirection :: Pt -> Pt -> Bool Source #

Check if the dot product of a and by is greater than 0 and the direction is same.

getDirectionVector :: Pt -> Pt -> Pt Source #

Get the direction vector of given points. Pass bc as first parameter.