IsPerpendicular checks if two lines are perpendicular or not.
(l1, l2 *Line)
| 45 | |
| 46 | // IsPerpendicular checks if two lines are perpendicular or not. |
| 47 | func IsPerpendicular(l1, l2 *Line) bool { |
| 48 | return Slope(l1)*Slope(l2) == -1 |
| 49 | } |
| 50 | |
| 51 | // PointDistance calculates the distance of a given Point from a given line. |
| 52 | // The slice should contain the coefficiet of x, the coefficient of y and the constant in the respective order. |