The distance between two sets of parallel lines is calculated, the point on each segment is known, and the angle with the coordinate system is 15 degrees.

clipboard.png

Mar.13,2021

Trigonometric function formula

do the math by yourself

< hr >

first calculate a set of parallel lines on the right and extend the lower parallel lines to intersect with the x-axis for convenient analysis. Get:
cos15 = the distance between the two parallel lines on the right / (y1-y2)

the same on the left

< hr >

var distanceR = Math.acos (15 / 360 2 Math.PI) * (y2-y1)

trigonometric functions in js refer to https://developer.mozilla.org.


if there are no other restrictions, there are countless sets of parallel lines that meet the conditions, and the distance cannot be determined

.
Menu