data Geometry = Point {xCoord:: Double
,yCoord:: Double} |Line {xCoeff:: Double
,yCoeff:: Double
,constant:: Double}|Plane {xCoeff:: Double,yCoeff:: Double,
zCoeff::Double,
constant::Double} deriving (Show)
intersection:: Geometry -> Geometry -> Either String Geometry
intersection (Line a1 b1 c1) (Line a2 b2 c2)
| #### some code
intersection (Plane a1 b1 c1 d1) (Plane a2 b2 c2 d2)
| #### some code
| n1_n2_z /= 0 = Right $ParamerticLine (Point3D t1 (cond12/n1_n2_z) 0) (Point3D n1_n2_x n1_n2_y n1_n2_z)
| otherwise ## some code
where {Point t1 t2 = intersection (Line a1 b1 d1) (Line a2 b2 d2)}
I am trying to compute intersection of line in where clause of intersection of plane and using t1 in condition n1_n2_z/=0. I am getting error for where clause. Could I use intersection function as defined in where clause. What am I doing wrong in where clause?