How to rotate a dashed line in 8steps of like 45 degrees until it covers 360 degrees using C++ programming language. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to rotate a dashed line in 8steps of like 45 degrees until it covers 360 degrees using C++ programming language.

Rotation

28th Apr 2020, 7:15 PM
Josphat Mwangi
Josphat Mwangi - avatar
2 Answers
+ 3
You mean like this? First step: | Next step: / Next step: - Next step: \ Next step: |
17th Jun 2020, 9:47 AM
Prabhanshu Chaturvedi
+ 3
There are two things that can be done: 1. You can fix the line at a point and change coordinates of it accordingly. 2. Use the rotation matrix to show rotation up to any limit. (Rotation matrix R={cosA, -sinA, sinA, cosA})
19th Jun 2020, 3:56 AM
Prabhanshu Chaturvedi