I am working with vectors in graphs. The first part of the program generates a random position point of a vector on the graph. Next, I want the program to generate another random position point of a vector on the graph. How do I generate the second position vector, keeping in mind that the distance between both position vectors has to be 1?
x
between 0 and 360 (or between 0 and 2*PI if you use radians). cos(x)
to the x-value of the first random position point sin(x)
to the y-value of the first random position point Why? Geometry. All the points on the circle (cos(x), sin(x))
are always 1 unit length away from its center.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.