P
P
Praud2019-05-15 13:54:50
JavaScript
Praud, 2019-05-15 13:54:50

How to find the angle between two vectors on a canvas?

Hello. I've always had a little trouble with math.
I have the following task:
There are two vectors on the canvas and I need to calculate the angle between them.
5cdbef921159e957959286.png5cdbef9932d77141365225.png
What is the formula for how to calculate this angle?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
EVGENY T., 2019-05-15
@Beshere

cos(alfa) = (a * b) / (|a| * |b|)
Vectors, I hope you know how to multiply.

G
GreatRash, 2019-05-15
@GreatRash

https://jsfiddle.net/pnur201L/1/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question