Discussion:
Rotating lines
Jim Wagner
2016-12-21 18:00:43 UTC
Permalink
In the beginning, the set of vectors would be defined by their Cartesian Coordinates. Convert those to polar (length and one angle, assuming this is all in a single plane). Then simply change all of the vector angles in that figure by the rotation angle. Then convert back to Cartesian. The center (e.g., the origin of the coordinate system) has not moved, so you can easily determine the coordinates of the tip of each vector. These, then, become the vertices of the rotated figure.

Jim

James Wagner
Oregon Research Electronics
http://www.orelectronics.net <http://www.orelectronics.net/>
Should have written: Let the VERTICES of the figure define vectors ….
Jim
cool thanks.
_______________________________________________
https://forum.xojo.com/
__________________________________________
Jim Wagner
2016-12-21 02:08:49 UTC
Permalink
By the way your third DrawLine will be drawn right on top off the first, and the fourth will be drawn right on top of the second.

Jim
James Wagner
Oregon Research Electronics
http://www.orelectronics.net <http://www.orelectronics.net/>
Hi -
I have a function that sort of draws a diamond shape on screen, via g.drawline.
I'm trying to figure how to have it look like its rotating. I'm not quite sure on
the values/calculations part.
this is from my function which I pass graphics and value as integer.
The value will be used for other things.
g.ForeColor = &Cffffff
g.DrawLine(83,125,167,75)
g.DrawLine(167,75,250,125)
g.DrawLine(83,125,167,175)
g.DrawLine(167,175,250,125)
Thanks
_______________________________________________
https://forum.xojo.com/
_______________________________________________

Xojo forum:

https://forum.xojo.com/

Continue reading on narkive:
Loading...