Simple astroid curve
in
Programming Questions
•
1 year ago
Hi,
Below is my attempt at plotting an Astroid curve.
The formula is "x = a cos3(t), y = a sin3(t)"
Why is this coming out wrong?
Thanks!
- float x, y;
- float theta = 100.0;
- void setup() {
- size(400, 400);
- background(255);
- smooth();
- }
- void draw() {
- background(255);
- pushMatrix();
- translate(width/2, height/2);
- for (int a = 0; a < 100; a++) {
- x = cos(pow(a, 3)) * theta;
- y = sin(pow(a, 3)) * theta;
- point(x, y);
- }
- popMatrix();
- }
1