Replaces uses of elements
with toVect
This commit is contained in:
parent
598e60c2da
commit
f6809697e8
|
@ -176,7 +176,7 @@ Traversable (Point n) where
|
||||||
|
|
||||||
export
|
export
|
||||||
Show a => Show (Point n a) where
|
Show a => Show (Point n a) where
|
||||||
showPrec d (MkPoint v) = showCon d "point" $ showArg $ elements v
|
showPrec d (MkPoint v) = showCon d "point" $ showArg $ toVect v
|
||||||
|
|
||||||
export
|
export
|
||||||
Cast a b => Cast (Point n a) (Point n b) where
|
Cast a b => Cast (Point n a) (Point n b) where
|
||||||
|
|
|
@ -186,8 +186,8 @@ perp a b = a.x * b.y - a.y * b.x
|
||||||
||| Calculate the cross product of the two vectors.
|
||| Calculate the cross product of the two vectors.
|
||||||
export
|
export
|
||||||
cross : Neg a => Vector 3 a -> Vector 3 a -> Vector 3 a
|
cross : Neg a => Vector 3 a -> Vector 3 a -> Vector 3 a
|
||||||
cross v1 v2 = let [a, b, c] = elements v1
|
cross v1 v2 = let [a, b, c] = toVect v1
|
||||||
[x, y, z] = elements v2
|
[x, y, z] = toVect v2
|
||||||
in vector [b*z - c*y, c*x - a*z, a*y - b*x]
|
in vector [b*z - c*y, c*x - a*z, a*y - b*x]
|
||||||
|
|
||||||
||| Calculate the triple product of the three vectors.
|
||| Calculate the triple product of the three vectors.
|
||||||
|
|
Loading…
Reference in a new issue