Small Basic Forum
Challenge 12 - Rotating triangle - Printable Version

+- Small Basic Forum (https://litdev.uk/mybb)
+-- Forum: Small Basic (https://litdev.uk/mybb/forumdisplay.php?fid=1)
+--- Forum: Challenges (https://litdev.uk/mybb/forumdisplay.php?fid=5)
+--- Thread: Challenge 12 - Rotating triangle (/showthread.php?tid=242)



Challenge 12 - Rotating triangle - litdev - 02-17-2025

Create a triangle shape in the center of a GraphicsWindow and rotate it left and right with arrow keys.

This is trickier than you may think NOT using an extension and will need some experimentation to work out the rules for it.

When you get this you could extend to using the line shape to make clock hands.


RE: Challenge 12 - Rotating triangle - jrmrhrb00 - 02-23-2025

LitDev,

Is this what you want for this?

GCKH495.000

JR


RE: Challenge 12 - Rotating triangle - AbsoluteBeginner - 02-23-2025

Hello.  Shy

Maybe LitDev meant to create a triangle and rotate it around the center of the graphics window?  Undecided

If you just create a triangle in the center of the window and rotate it, then it's too simple.


RE: Challenge 12 - Rotating triangle - jrmrhrb00 - 02-23-2025

AB,

I thought he meant to rotate the triangle around the triangle's own center. We'll see.

JR


RE: Challenge 12 - Rotating triangle - WhTurner - 02-23-2025

My solution for four different situations  TZNX670.000


RE: Challenge 12 - Rotating triangle - jrmrhrb00 - 02-23-2025

WHTurner,

Good program. I didn't think about showing that way!

JR


RE: Challenge 12 - Rotating triangle - AbsoluteBeginner - 02-23-2025

Yes, an interesting program.  Shy

It would be cool to be able to go back to the start screen to choose another option to watch.  Blush


RE: Challenge 12 - Rotating triangle - litdev - 02-24-2025

(02-23-2025, 12:16 AM)jrmrhrb00 Wrote: LitDev,

Is this what you want for this?

GCKH495.000

JR

Yes, that all it is - about understanding where the center of rotaion comes from for triangles and lines - the idea came from this question:

https://learn.microsoft.com/en-us/answers/questions/2155806/microsoft-small-basic-triangle-issue


RE: Challenge 12 - Rotating triangle - litdev - 02-24-2025

(02-23-2025, 06:19 PM)WhTurner Wrote: My solution for four different situations  TZNX670.000

Yes this is the idea, but I was suggesting using the Shapes.Rotate command which would need more investigation into what how the rotation with triangles and lines is achieved.

Here is my effort where I try to explain how the rotation for these shapes work, DLMQ566.000


RE: Challenge 12 - Rotating triangle - AbsoluteBeginner - 02-24-2025

This is interesting.  Rolleyes

I have never faced such a task before.