We are about to switch to a new forum software. Until then we have removed the registration on this forum.
In the processing language, how to draw a circle and lines with a dotted line? Can it be achieved? like this? :)
Demo below. Typically, you provide your attempt or you describe what part you are struggling.
Kf
final float N=100; float da=TWO_PI/N; float rad=100; PVector centroid =new PVector(width/2,height/2); size(400,500); fill(255,0,0); for(float a=0;a<TWO_PI;a+=da){ ellipse(centroid.x+rad*cos(a),centroid.x+rad*sin(a),5,5); }
Is there any other way? For example, set a function to make straight lines at intervals every other period?
You can write your own function
Based on the code above
N is the number of steps
If you want a library for dashed lines on a wide variety of shapes, try Dashed Lines for Processing:
For lines, the Processing reference also has an example of using lerp to draw dotted lines.
This method can be used radially as well for r rather than x,y.
Answers
Demo below. Typically, you provide your attempt or you describe what part you are struggling.
Kf
Is there any other way? For example, set a function to make straight lines at intervals every other period?
You can write your own function
Based on the code above
N is the number of steps
If you want a library for dashed lines on a wide variety of shapes, try Dashed Lines for Processing:
For lines, the Processing reference also has an example of using lerp to draw dotted lines.
This method can be used radially as well for r rather than x,y.