GeomAlg-0.2.3: Library of geometric algorithms in HaskellSource codeContentsIndex
GeomAlg.Point3
Description
3 dimensional points.
Synopsis
module GeomAlg.Point
newtype Point3 a = Point3 (a, a, a)
type P3 a = Point3 a
cross3 :: Num a => Point3 a -> Point3 a -> Point3 a
volume6 :: Num a => P3 a -> P3 a -> P3 a -> P3 a -> a
Documentation
module GeomAlg.Point
newtype Point3 a Source
Constructors
Point3 (a, a, a)
show/hide Instances
type P3 a = Point3 aSource
cross3 :: Num a => Point3 a -> Point3 a -> Point3 aSource
volume6 :: Num a => P3 a -> P3 a -> P3 a -> P3 a -> aSource

See [R94, p.26-27, p. 142, p. 157] | This code is dangerous: the calculations may easily cause overflow | Choose the data type carefully.

Examples:

volume6 (Point3 (512,512,512)) (Point3 (512,-512,-512)) (Point3 (-512,512,-512)) (Point3 (-512,-512,512)) :: Integer 2147483648 :: Integer

volume6 (Point3 (600003,0,0)) (Point3 (0,600003,0)) (Point3 (0,0,600003)) (Point3 (200001,200001,200001)) 0 :: Int

But:

volume6 (Point3 (600003,0,0)) (Point3 (0,600003,0)) (Point3 (0,0,600003)) (Point3 (200001,200001,200001)) :: Double 1.71799e+10 :: Double

Produced by Haddock version 2.4.2