-
Notifications
You must be signed in to change notification settings - Fork 1
Special Shapes
wang429 edited this page Dec 30, 2011
·
4 revisions
Creates a Shape containing vertices resembling a circle
- Vector center
- integer radius
- double/float angle. ** In radians ** multiplied by pi ** somewhat helps with determining resolution.
x = radius * cos(angle);
y = radius * sin(angle);
where theta is incremented by angle to create circle. Inserted Vectors will be shifted by center values.
- Not sure if calculating for only one quadrant and using negatives for the rest is faster or worth the time saved.
- Still need to determine a resolution for circles.
Makes a Shape containing vertices in the shape of a rectangle
- Vector corner (bottom left)
- int width
- int height
clockwise insert of 4 points. corner, corner + (0,height), corner + (width,height), corner + (width,0)
Squares will just use makeRect();