Package org.openstreetmap.josm.actions
Class AlignInLineAction.Line
java.lang.Object
org.openstreetmap.josm.actions.AlignInLineAction.Line
- Enclosing class:
- AlignInLineAction
Class that represent a line
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintersectionCommand(Node n, AlignInLineAction.Line other) Intersection of two line.Orthogonal projection of a node N along this line.
-
Field Details
-
a
Line equation ax + by + c = 0 Such as a^2 + b^2 = 1, ie (-b, a) is a unit vector of line -
b
-
c
-
xM
(xM, yM) are coordinates of a point of the line -
yM
-
-
Constructor Details
-
Line
Line(Node first, Node last) throws AlignInLineAction.InvalidSelection Init a line by 2 nodes.- Parameters:
first- One point of the linelast- Other point of the line- Throws:
AlignInLineAction.InvalidSelection- if nodes have same coordinates
-
Line
Line(Way way) throws AlignInLineAction.InvalidSelection Init a line equation from a way.- Parameters:
way- Use extremity of this way to compute line equation- Throws:
AlignInLineAction.InvalidSelection- if nodes have same coordinates
-
-
Method Details
-
projectionCommand
Orthogonal projection of a node N along this line.- Parameters:
n- Node to be projected- Returns:
- The command that do the projection of this node
-
intersectionCommand
public Command intersectionCommand(Node n, AlignInLineAction.Line other) throws AlignInLineAction.InvalidSelection Intersection of two line.- Parameters:
n- Node to move to the intersectionother- Second line for intersection- Returns:
- The command that move the node
- Throws:
AlignInLineAction.InvalidSelection- if two parallels ways found
-