You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importLinefrom'math-2d/Line';// creation line with common line equation (Ax+By+C=0) coefficients A,B and Cconstline=newLine(A,B,C);// getting A coefficient of common line equationline.A// getting B coefficient of common line equationline.B// getting C coefficient of common line equationline.C// getting direction vector lengthline.length// calculate point value through common line equationline.calc(point)// calculate x coordinate value through common line equationline.calcX(y)// calculate y coordinate value through common line equationline.calcY(x)// object representation of the lineline.toObject()// string representation of the lineline.toString()
Static methods and properties
// creation line by to defined pointsLine.createFromPoints(pointA,pointB)// returns the shortest distance between line and pointLine.getDistance(line,point)// return angle between two linesLine.getAngle(lineA,lineB)// returns true if lines are sameLine.areSame(lineA,lineB)// returns true if lines are parallelLine.areParallel(lineA,lineB)// returns new line that perpendicular to defined line and come through pointLine.getPerpendicular(line,point)// returns true if two lines are perpendicularLine.arePerpendicular(lineA,lineB)// returns the point of line intersectionLine.getIntersect(lineA,lineB)// returns true if point is align to lineLine.isAlign(line,point)// returns the closest point on the line to the defined pointLine.getClosestPointTo(line,point)// returns two points on the line at defined distance from the defined pointLine.getPointsAtDistance(line,point,distance)