Midpoint of an arc
in
Programming Questions
•
2 years ago
Hey guys,
I'm desesperatly trying to find the X and Y position of the midpoint of an arc.
Take this simple code:
- void setup(){
- size(100, 100);
- background(255);
- smooth();
- rectMode(CENTER); // show bounding box
- stroke(128);
- rect(10, 10, 150, 150);
- stroke(0);
- arc(10, 10, 150, 150, 0, PI/2.0); // lower quarter circle
- }
How would I be able to insert a tiny ellipse on the midpoint of the curve?
I tried hundreds of ways using sin/cos, but nothing worked. This, of course, would have to be dynamic (depending on the radius and start/stop angles of the arc).
Thank you very much for your time. I greatly appreciate it.
1