V
V
vaselekk2021-01-17 03:08:18
Geometry
vaselekk, 2021-01-17 03:08:18

How to calculate the position of a vector?

Given a vector - it's free, and it starts at the coordinate (0,0) .

How to calculate the coordinate of a vector x, y ? (I mean where its final point in x, y will be), if the angle of 35 degrees is known, and its length is 4 cm.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
Fallenyasha, 2021-01-17
@Fallenyasha

x0 = 0
y0 = 0
angle = 35
r = 4
x = x0 + cos(angle) * r
y = y0 + sin(angle) * r

G
Grigory Boev, 2021-01-17
@ProgrammerForever

You need polar coordinates
Formulas to translate:

x = x0 + R*cos(phi)
y = y0 + R*cos(pi/2 - phi) = y0 + R*sin(phi)

They are based on the fact that the projection of a vector onto an axis (or, in general, a direction) is the length of the vector multiplied by the angle between the axis (or direction) and the vector. The angle is counted counterclockwise from the direction to the vector. If the angle is "uncomfortable" (more than 180 degrees, for example), then it still needs to be taken. Well, or take a smaller "convenient" angle and take into account the projection direction in the formula - if the projection direction coincides with the positive direction of the axis, then we put "+", if in the opposite direction - then "-".

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question