Answer the question
In order to leave comments, you need to log in
How to draw a ray with a function based on two points and calculate the intersection of the perpendicular from the third point on the ray?
There are three points with coordinates:
var pos1 = {x:(число), y:(число)},
pos2 = {x:(число), y:(число)},
pos3 = {x:(число), y:(число)};
Answer the question
In order to leave comments, you need to log in
1) Calculate the equation of a straight line passing through points 1 and 2
, we express y through x, we get the equation
and express y through x, we get
y = a₂x + b₂
3) There are equations of lines - you need find the intersection, i.e. solve a system of two linear equations. There are a lot of methods here - from simple transformations to matrices. because we have equations in the form y=f(x) , then we can do this:
приравниваем уравнения 1 и 2, избавляемся тем самым от y
вычисляем x
подставляем найденное x в любое уравнение
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question