code: public static Vector2d calculatePerpendicularUnitVector(Point2d point1, Point2d point2) {
          Vector2d vector = new Vector2d();
          vector.sub(point2, point1);
          vector.normalize();
  
          // Return the perpendicular vector
          return new Vector2d(-1.0 * vector.y, vector.x);
      }
docs: Determines the normalized vector orthogonal on the vector p1-&gt;p2.
  
  @param  point1  Description of the Parameter
  @param  point2  Description of the Parameter
  @return     Description of the Return Value