Replaces uses of elements
with toVect
This commit is contained in:
parent
598e60c2da
commit
f6809697e8
|
@ -176,7 +176,7 @@ Traversable (Point n) where
|
|||
|
||||
export
|
||||
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
|
||||
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.
|
||||
export
|
||||
cross : Neg a => Vector 3 a -> Vector 3 a -> Vector 3 a
|
||||
cross v1 v2 = let [a, b, c] = elements v1
|
||||
[x, y, z] = elements v2
|
||||
cross v1 v2 = let [a, b, c] = toVect v1
|
||||
[x, y, z] = toVect v2
|
||||
in vector [b*z - c*y, c*x - a*z, a*y - b*x]
|
||||
|
||||
||| Calculate the triple product of the three vectors.
|
||||
|
|
Loading…
Reference in a new issue