Post Reply 
Circle with interior arc segments
02-10-2015, 06:45 PM
Post: #1
Circle with interior arc segments
How would one calculate and plot circular arc segments laying totally within a semi-circle? Each segment begins at the right hand side (0*pi), and intersects the semi-circle circumference on pi/6, 2*pi/6, 3*pi/6 ... 6*pi/6, boundary intervals?

This is the idea, but method needs work!:
Code:

EXPORT Circ()
BEGIN
LOCAL a;
DIMGROB(G1,320,240);

ARC_P(G1,156,109,105,0,pi,RGB(255,0,0));  //  Semicircle center: (156,109), radius: 105 pixels
LINE_P(G1,51,109,261,109,RGB(255,0,0));  

FOR a  FROM 0 TO pi STEP pi/6 DO
  LINE_P(G1,156,109,156+ROUND(105*COS(a),1),109-ROUND(105*SIN(a),1),RGB(210,210,210));  //  pi/6 segment indicator
  ARC_P(G1,261,105*SIN(a)/2,105*COS(a),pi,3*pi/2,RGB(0,0,255));  //  This approach isn't working ...
END;

BLIT_P(G0,G1);
DRAWMENU("");
FREEZE;

END;

Thanks!
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Circle with interior arc segments - DrD - 02-10-2015 06:45 PM



User(s) browsing this thread: 1 Guest(s)