A Line class consists of two points, i. e. instances of the Coordinate class.
constructor(point1: Coordinate, point2: Coordinate)
Build a Line object with point1 and point2.
setPoint1(point1: Coordinate)
Update the first point.
getPoint1()
Return the first point (Coordinate).
setPoint2(point2: Coordinate)
Update the second point.
getPoint2()
Return the second point (Coordinate).
getPoints()
Return an array with the first and second point (Array<Coordinate>)
getLength(calculator: DistanceInterface)
Return the length of Line (Distance between the first and second point) using the calculator (number)
getReverse()
Return a Line of where the points are reversed (Line)
Ajouter un commentaire