One vector calculation behind four input methods
For direction vectors u and v, the calculator uses θ = atan2(|cross(u,v)|, dot(u,v)) to obtain a stable 0–180 degree separation. It then resolves the smaller line angle, the larger or supplementary angle, reflex counterpart, directed clockwise and counterclockwise turns, and parallel or perpendicular status with an explicit tolerance.
Canvas points are useful for a visual sketch. Coordinates subtract endpoint pairs to form vectors. A finite slope m becomes (1,m), while a vertical line becomes (0,1). A direction angle becomes (cos θ,sin θ). Zero-length coordinate lines are rejected instead of producing a plausible number.
Choose an input that matches the evidence
- Draw mode: click start and end for line one, then start and end for line two.
- Coordinates mode: enter x1,y1 to x2,y2 and x3,y3 to x4,y4; endpoint location does not matter once each direction vector is formed.
- Slopes mode: enter finite slopes or mark a line vertical rather than using an infinite numeric placeholder.
- Direction mode: enter two angles measured counterclockwise from the positive x-axis.
- Copy the interpreted result or share a numeric-mode URL. Canvas data and files are never serialized into the query string.
Direction ambiguity and numeric tolerance
- An undirected line has no preferred arrow, so acute and obtuse answers can both describe the same line pair; the output names both.
- Reversing one segment direction changes clockwise and counterclockwise results but not the smaller undirected angle.
- Parallel and perpendicular labels use a small floating-point tolerance rather than exact binary equality.
- The atan2 cross/dot form remains stable near perpendicular slopes and avoids relying on a formula singular when m1×m2 approaches −1.
- Coordinate endpoints must be distinct; longer drawn segments are easier to place accurately on the blank canvas.
Equivalent worked inputs
- Coordinates (0,0)→(4,0) and (0,0)→(4,4) give a 45° smaller angle.
- Slopes 0 and 1 convert to (1,0) and (1,1), producing the same 45° result.
- Direction angles 0° and 45° also produce 45°, confirming mode consistency.
- A drawn horizontal line and 45° diagonal provide the same visual case, subject only to pointer placement.
- Horizontal and vertical inputs report 90° and perpendicular status without an infinite-slope calculation.
Formula substitution example
For u=(4,0) and v=(4,4), cross is 16 and dot is 16. atan2(|16|,16)=45°. Reversing v gives cross −16 and dot −16, so the 0–180 directed-vector separation is 135°, while the smaller undirected line angle remains 45°.
- Zero vector: error.
- Opposite vectors: 180° directed separation and 0° line separation.
- Perpendicular vectors: dot 0 and 90°.
Lines, segments, and directed turns
The calculator does not detect lines in uploaded images. In blank-canvas mode it uses the four points you draw. Numeric query parameters contain only the entered numbers and mode. Directed results depend on endpoint order, while undirected smaller and larger angles describe the supporting lines.
Only numeric coordinates, slopes, vertical flags, or direction angles may be written to the URL. No upload content is accepted on this page.