You're going to need to use
arc() in combination with a little bit of trigonometry to draw the head...
Something like this?
(This is sort of a proof-of-concept sketch that I made)
- void setup() {
- size(400, 400);
- smooth();
- }
- void draw() {
- background(255);
- circArrow(200, 200, 100, 0, radians(mouseX % 360), 10);
- }
- void circArrow(float x, float y, float radius, float start, float stop, float arrowSize) {
- ellipseMode(CENTER);
- noFill();
-
- arc(x, y, radius * 2, radius * 2, start, stop);
-
- float arrowX = x + cos(stop) * radius;
- float arrowY = y + sin(stop) * radius;
-
- float point1X = x + (cos(stop) * radius) + (cos(stop - radians(arrowSize * 5)) * (arrowSize));
- float point1Y = y + (sin(stop) * radius) + (sin(stop - radians(arrowSize * 5)) * (arrowSize));
-
- float point2X = x + (cos(stop) * radius) + (cos(stop - radians(-arrowSize * 5)) * (-arrowSize));
- float point2Y = y + (sin(stop) * radius) + (sin(stop - radians(-arrowSize * 5)) * (-arrowSize));
-
- line(arrowX, arrowY, point1X, point1Y);
- line(arrowX, arrowY, point2X, point2Y);
- }