<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
      <title>Tagged with arc() - Processing 2.x and 3.x Forum</title>
      <link>https://forum.processing.org/two/discussions/tagged/feed.rss?Tag=arc%28%29</link>
      <pubDate>Sun, 08 Aug 2021 17:43:07 +0000</pubDate>
         <description>Tagged with arc() - Processing 2.x and 3.x Forum</description>
   <language>en-CA</language>
   <atom:link href="/two/discussions/taggedarc%28%29/feed.rss" rel="self" type="application/rss+xml" />
   <item>
      <title>can anyone help with pushmatrix?</title>
      <link>https://forum.processing.org/two/discussion/28131/can-anyone-help-with-pushmatrix</link>
      <pubDate>Tue, 02 Oct 2018 21:50:25 +0000</pubDate>
      <dc:creator>laptophead</dc:creator>
      <guid isPermaLink="false">28131@/two/discussions</guid>
      <description><![CDATA[<p>I am modeling this robotic arm and it looks great.</p>

<p>I am also trying to display each angle next to each point of inflexion. 
In the case of the elbow, I am trying to move the text with the elbow position along with the inflexion point. 
That works, but I cant find a method to keep the writing horisontal.
It rotates with the first segment angle...</p>

<p>here is my function</p>

<p>thanks</p>

<p>void ArmDepiction()</p>

<p>{  ///////////////////////////Base orientation</p>

<p>fill(201, 0, 211); // magenta
  //text("Y:", LS, spaceDown*3 ); 
  text( (nf(degrees(BaseAngRad), 0, 1)), 630, 1050);
  //text( "0", 85, 0);</p>

<p>strokeWeight(10);
stroke(238,242, 0);
noFill ();</p>

<p>// Form: arc(x, y, width, height, start, stop, type);
arc(550, 1000, 100, 100, (PI/2), (BaseAngRad+(PI/2)), PIE);
//stroke(#71B28F);
//arc(100, 1000, 175, 175, 0, 2*PI, 0);</p>

<p>//drawArrow(100,160,50,130);</p>

<p>///////////////////////Arm Depiction
  strokeWeight(40);
  stroke(255, 160);
  strokeCap(ROUND);</p>

<p>float x, y;</p>

<p>x = 550;
  y = 800;</p>

<p>pushMatrix();
  strokeWeight(40);
  segment(x, y, PI+ShoAngRad); 
  strokeWeight(30);
  segment1(segLength, 0, PI+ElbowAngRad); // 120 is the starting point
  segment3(segLength, 0, (2*PI)+ElbowAngRad-0.58); // 100 is the segment length
  popMatrix();</p>

<p>translate(x, y);
strokeWeight(10);
strokeJoin(ROUND);
   beginShape();
  vertex(-40, 0);</p>

<p>vertex(-65, segLength);
  vertex(65, segLength);</p>

<p>vertex(40, 0);
  endShape(CLOSE);</p>

<p>DisplayElAngle(x, y);</p>

<p>}</p>

<p>void segment(float x, float y, float a) {
  translate(x, y);
  fill(201, 0, 211); // magenta
  //text("Y:", LS, spaceDown*3 ); 
  text( (nf(degrees(ShoAngRad), 0, 1)), 30, 0);
  //text( "0", 85, 0);
  noFill ();</p>

<p>rotate(a);
  line(0, 0, segLength, 0); // 100 is the segment length</p>

<p>}</p>

<p>void DisplayElAngle(float x, float y) {
  translate(x, y);
  rotate(2<em>PI);
    fill(201, 0, 211); // magenta
  //text("Y:", LS, spaceDown</em>3 ); 
 text( (nf(degrees(ElbowAngRad), 0, 1)), 20, -10);
  noFill ();
 //</p>

<p>}
void segment1(float x, float y, float a) {
  translate(x, y);
    fill(201, 0, 211); // magenta
  //text("Y:", LS, spaceDown*3 ); 
 text( (nf(degrees(ElbowAngRad), 0, 1)), 20, -10);
  noFill ();
  rotate(a);
  line(0, 0, segLength, 0); // 100 is the segment length
   // rotate(a);</p>

<p>}</p>

<p>void segment3(float x, float y, float a) {
  translate(x, y);
  rotate(a);
  line(0, 0, (segLength/5), 0); // 100 is the segment length</p>

<p>}</p>
]]></description>
   </item>
   <item>
      <title>Label PieChart</title>
      <link>https://forum.processing.org/two/discussion/27781/label-piechart</link>
      <pubDate>Mon, 16 Apr 2018 18:12:15 +0000</pubDate>
      <dc:creator>res</dc:creator>
      <guid isPermaLink="false">27781@/two/discussions</guid>
      <description><![CDATA[<p>Hi,
i hope somebody could help me because i should do the Project for my work.
I created a pie Chart but i dont know how i can place the Label.</p>

<p>In the middle of the arc (outside the Circle) there should be the Label.</p>

<pre><code>for (Rohtipps g : myRohtipp) {

    //PVector c = randomVector(mapped);
    //draw ellipse
    PVector loc = g.getLocation();
    float dia = g.getDiameter();
    //noFill();

    float[] data={g.getColdlead(), g.getWarmlead(), g.getHotlead()};

    //float[] data={50.0, 50.0, 50.0, 50.0};
    float sumdata=0;
    for (int i=0; i&lt;data.length; i++) {
      sumdata+=data[i];
    }
    //println(sumdata);
    sumdata = 360/sumdata;

    for (int i=0; i&lt;data.length; i++) {
      data[i] = sumdata*data[i];
    }
    float lastAngle=0;

    for (int i=0; i&lt;data.length; i++) {
       float col=map(i, 0, data.length, 20, 255);
       fill(55, 150, col, col+100);
       noStroke();
       arc(loc.x, loc.y, dia, dia, lastAngle, lastAngle+radians(data[i]));
       lastAngle +=radians(data[i]);

    }

    //println(g.getKampagne()+" "+g.getColdlead()+" "+g.getWarmlead()+" "+g.getHotlead());
    //pieChart(dia, loc.x, loc.y, data);
    //ellipse(loc.x, loc.y, dia, dia);
    fill(40, 40, 40);
    //label positionieren
    textSize(11);


    float tw=(textWidth(g.getKampagne()))/2;
    text(g.getKampagne(), loc.x-tw, loc.y+30);

    //println(g.getAnzahl());
    ts=ts-2;
    textSize(ts);
    fill(30, 30, 30);
    text(g.getKampagne()+" "+g.getAnzahl(), 1400, g.getPositionText());
    textSize(24);
    //println(g.getColdlead());
  }
</code></pre>

<p>Thanks
Theresa</p>
]]></description>
   </item>
   <item>
      <title>How to control the progress bar of the ring?</title>
      <link>https://forum.processing.org/two/discussion/26874/how-to-control-the-progress-bar-of-the-ring</link>
      <pubDate>Fri, 16 Mar 2018 07:17:45 +0000</pubDate>
      <dc:creator>Happier</dc:creator>
      <guid isPermaLink="false">26874@/two/discussions</guid>
      <description><![CDATA[<p>Hello Processing Community, I have created a sketch , but how to present and use the keyboard to click control? and  how to create this type of progressbar？</p>

<p>waiting for your suggestions and trying my best for this...</p>

<p>regards ...</p>

<p><img src="https://forum.processing.org/two/uploads/imageupload/469/H43VDHP0COA4.png" alt="ring" title="ring" /></p>
]]></description>
   </item>
   <item>
      <title>Problem drawing with p5.js</title>
      <link>https://forum.processing.org/two/discussion/26541/problem-drawing-with-p5-js</link>
      <pubDate>Mon, 26 Feb 2018 16:20:26 +0000</pubDate>
      <dc:creator>AjejeBrazorf</dc:creator>
      <guid isPermaLink="false">26541@/two/discussions</guid>
      <description><![CDATA[<p>Hi,
I state that I'm new to p5.js, i'm having an issue drawing things.
I got this code that draw a Golden Ratio Rectangle:</p>

<pre><code>var y,x;
var sliderx,slidery;
const GoldenRatio = (1 + Math.sqrt(5)) / 2;


function setup() {
  createCanvas(1920/3*2,1080/3*2);
  background(255, 204, 0);
  sliderx = createSlider(0,1500,1200,1);
  console.log(x);
  console.log(y);
}

function draw() {
  x = sliderx.value();
  y = x / GoldenRatio;
  noFill();
  rect(1,0,x-2,y);
  GoldenRatioDraw(x,y);
}

function GoldenRatioDraw(x,y){
  if(x&gt;0 &amp;&amp; y&gt;0){
  push();
  translate(y,y);
  line(0,0,0,-y);
  arc(0,-y,y * 2,y * 2,PI/2,PI);
  rotate(3* PI /2);
  translate(x-y);
  GoldenRatioDraw(y,x-y);
  pop();
  }
}
</code></pre>

<p>When I change the x value with the slider, I want it to change the dimension of the rectangle not to draw a new one and overlay the old one.(sorry for bad english :) )</p>

<p>Can you help me?</p>
]]></description>
   </item>
   <item>
      <title>P5 back and forth animation</title>
      <link>https://forum.processing.org/two/discussion/25782/p5-back-and-forth-animation</link>
      <pubDate>Tue, 02 Jan 2018 06:07:48 +0000</pubDate>
      <dc:creator>Amorris</dc:creator>
      <guid isPermaLink="false">25782@/two/discussions</guid>
      <description><![CDATA[<p>I have this sketch:</p>

<pre><code>let h = 0;
let k = 0;
let step = 0.05;
let r = 200;
let points = [];
let i = 0;
let forward = true;

function setup() {
  createCanvas(windowWidth, windowHeight);
}

function draw() {
  background(81);
  translate(width / 2, height / 2);
  noFill();
  strokeWeight(1);
  stroke(255);

  beginShape();
  for (let theta = TWO_PI; theta &gt; PI; theta -= step) {
    let x = h + r * Math.cos(theta);
    let y = k - r * Math.sin(theta);
    vertex(x, y);
    points.push(createVector(x, y));
  }
  endShape();

  strokeWeight(10);
  stroke(0);
  point(points[i].x, points[i].y);
}
</code></pre>

<p>That shows a dot moving from one side of an arc to another. When it gets to the end, however it teleports back to the start. I want to make it swing back and forth on the arc. I have tried it using the length of the points array, but that seems to be massively overflowed and it contains duplicate points. Is there a way to do this, or a better way to do what I have done?</p>
]]></description>
   </item>
   <item>
      <title>Ellipse from Arcs.</title>
      <link>https://forum.processing.org/two/discussion/24835/ellipse-from-arcs</link>
      <pubDate>Wed, 01 Nov 2017 15:45:49 +0000</pubDate>
      <dc:creator>mnkP5</dc:creator>
      <guid isPermaLink="false">24835@/two/discussions</guid>
      <description><![CDATA[<p>I can't seem to figure out how the first (last maybe?) arc is actually two arcs.</p>

<p>Here's a codepen: 
<a href="https://codepen.io/alexdaly/pen/pdjRvx" target="_blank" rel="nofollow">https://codepen.io/alexdaly/pen/pdjRvx</a></p>
]]></description>
   </item>
   <item>
      <title>Need help rotating a shape</title>
      <link>https://forum.processing.org/two/discussion/24682/need-help-rotating-a-shape</link>
      <pubDate>Sat, 21 Oct 2017 20:37:47 +0000</pubDate>
      <dc:creator>REOL</dc:creator>
      <guid isPermaLink="false">24682@/two/discussions</guid>
      <description><![CDATA[<p>Fixed it</p>

<p>Thanks regardless</p>
]]></description>
   </item>
   <item>
      <title>Check colision</title>
      <link>https://forum.processing.org/two/discussion/23643/check-colision</link>
      <pubDate>Sun, 30 Jul 2017 20:06:42 +0000</pubDate>
      <dc:creator>garwan50</dc:creator>
      <guid isPermaLink="false">23643@/two/discussions</guid>
      <description><![CDATA[<p>Hello,</p>

<p>i'm trying to do some kind of QTE game with p5.js, i have a question :</p>

<p><img src="https://cdn.discordapp.com/attachments/236955284474429440/341295506405982209/skillcheck.gif" alt="" /></p>

<p>How can I check if the red line is touching the black or the white arc ?</p>

<p>To move the red line i'm using the rotate function so i'm not sure how i should proceed.</p>

<p>I think what I want is to have coordinates of everything so i could compare but the rotate function kind of prevent that.</p>

<p>Here's the code : <a href="https://pastebin.com/WXvGbT9g" target="_blank" rel="nofollow">https://pastebin.com/WXvGbT9g</a></p>

<p>It's my first program using p5.js so sorry if it's a stupid question.</p>

<p>Thanks for your help !</p>

<p>(sorry for my english)</p>
]]></description>
   </item>
   <item>
      <title>Figuring out Values for Arc Rotation Oscillation</title>
      <link>https://forum.processing.org/two/discussion/23428/figuring-out-values-for-arc-rotation-oscillation</link>
      <pubDate>Thu, 13 Jul 2017 11:41:42 +0000</pubDate>
      <dc:creator>Philip_Lammes</dc:creator>
      <guid isPermaLink="false">23428@/two/discussions</guid>
      <description><![CDATA[<p><img src="https://forum.processing.org/two/uploads/imageupload/198/778FSTD8TMI2.png" alt="Arc Rotation Problem" title="Arc Rotation Problem" /></p>

<p>As you can see in this picture the arcs rotation, or start and stop values, change using the code as follows:</p>

<pre><code>arcAngle1 = Math.sin(freq*i) * arcAngle1Span + arcAngle1Start;
arcAngle2 = Math.sin(freq*i) * arcAngle2Span + arcAngle2Start;` 
</code></pre>

<p>where:</p>

<pre><code>arcAngle1Start = -HALF_PI;
arcAngle1Span = HALF_PI;
arcAngle2Start = HALF_PI;
arcAngle2Span= HALF_PI;
</code></pre>

<p>I am trying to figure out the values needed for it to sync so that the middle of the arc is always pointing in the so called direction of travel. It is possible that something else is wrong entirely and I'm thinking using the wrong method so here is the entire code for that reason: <a rel="nofollow" href="https://pastebin.com/nHFmHtYz">https://pastebin.com/nHFmHtYz</a></p>

<p>Thank you all in advance for any help.</p>
]]></description>
   </item>
   <item>
      <title>Reproducing a processing sketch in P5</title>
      <link>https://forum.processing.org/two/discussion/22505/reproducing-a-processing-sketch-in-p5</link>
      <pubDate>Wed, 10 May 2017 18:15:12 +0000</pubDate>
      <dc:creator>littlebrain</dc:creator>
      <guid isPermaLink="false">22505@/two/discussions</guid>
      <description><![CDATA[<p><img src="https://forum.processing.org/two/uploads/imageupload/141/2IMT4NFGZ3C4.PNG" alt="1" title="1" /></p>

<p>I'm trying to reproduce this processing sketch in P5 js, how do I put the arc in? The code says an arc but it looks more like square. The processing code for the arc - arc(width/2, height/2, sze, sze, incr, incr+ PI/2.0);
Can I use the same line in P5?</p>

<p><img src="https://forum.processing.org/two/uploads/imageupload/040/PAM1BM80F2DD.PNG" alt="2" title="2" /></p>
]]></description>
   </item>
   <item>
      <title>How do i flip an arc to other way?</title>
      <link>https://forum.processing.org/two/discussion/21957/how-do-i-flip-an-arc-to-other-way</link>
      <pubDate>Wed, 12 Apr 2017 18:09:13 +0000</pubDate>
      <dc:creator>lisa_weber</dc:creator>
      <guid isPermaLink="false">21957@/two/discussions</guid>
      <description><![CDATA[<p>this is my code, i want the arc to be facing upside, not upside down</p>

<p>void setup(){
  size(800,600);
}
void draw() {</p>

<p>fill(0);</p>

<p>arc(400, 200, 80, 80, 0, PI);
}</p>
]]></description>
   </item>
   <item>
      <title>How to stop many individual falling arcs at the bottom of the canvas so they fall on top each other</title>
      <link>https://forum.processing.org/two/discussion/21630/how-to-stop-many-individual-falling-arcs-at-the-bottom-of-the-canvas-so-they-fall-on-top-each-other</link>
      <pubDate>Mon, 27 Mar 2017 06:26:37 +0000</pubDate>
      <dc:creator>AlexC1091</dc:creator>
      <guid isPermaLink="false">21630@/two/discussions</guid>
      <description><![CDATA[<p>I am trying to figure out a way to create a screen full of falling arc's and I want to make them individually stop on top of each other when they reach a certain distance to the set y axis ( (if y &gt; 650) { stop();}. I have so far created a canvas with falling arc's except when one arc reaches the limit, all the other arc's stop as well. I am trying to find a way to solve this issue but I can't get around it. So I am currently stuck and not sure what to do. Here is what my code looks like. As you'll see, when one stops they all stop. I need them to stack on top of each other. Any help will be appreciated.</p>

<pre><code>Arc[] arc = new Arc[60];

void setup() {
  size(1500, 700);
  for (int i = 0; i &lt; arc.length; i++) {
    arc[i] = new Arc();
  }
}

void draw() {
  background(255);
  for (int i = 0; i &lt; arc.length; i++) {
    arc[i].fall();
    arc[i].show();
  }
}



class Arc {
  float x;
  float y;
  float z;
  float yspeed;

  Arc() {
    x  = random(width);
    y  = random(-500, -50);
    z  = random(0, 20);

    yspeed  = map(z, 0, 20, 1, 20); 
}
void fall() {
    y = y + yspeed;
    if (y &gt; 650) {
      stop();      
      yspeed = map(z, 0, 20, 4, 10);
    }
  }
  void show() {
    float thick = map(z, 0, 20, 1, 3);
    strokeWeight(5);

    stroke(0);
    arc(x, y, 20, 20, 0, PI);
  }
}
</code></pre>
]]></description>
   </item>
   <item>
      <title>Flaw in processing.org website pieChart example</title>
      <link>https://forum.processing.org/two/discussion/17771/flaw-in-processing-org-website-piechart-example</link>
      <pubDate>Sat, 06 Aug 2016 21:24:02 +0000</pubDate>
      <dc:creator>rtclay</dc:creator>
      <guid isPermaLink="false">17771@/two/discussions</guid>
      <description><![CDATA[<p>In the examples section on the website, the <a rel="nofollow" href="https://processing.org/examples/piechart.html">Pie Chart example</a> refers to the global "angles" array instead of the local function parameter "data".  The example works because the sketch only calls pieChart while passing in the "angles" array.  But a more robust, more copy-pasteable, less head-scratching example would refer to the "data" local variable instead of the "angle" global variable.</p>

<p>Who can make this change to the example on the website?  Also, it is not clear which category this post ought to go into.</p>
]]></description>
   </item>
   <item>
      <title>arc</title>
      <link>https://forum.processing.org/two/discussion/20998/arc</link>
      <pubDate>Sat, 25 Feb 2017 04:34:54 +0000</pubDate>
      <dc:creator>nitta</dc:creator>
      <guid isPermaLink="false">20998@/two/discussions</guid>
      <description><![CDATA[<p>I wrote this one.</p>

<p>function draw() {
  arc(50,55,60,60,PI,PI);
}</p>

<p>I thought nothing would appear.
but It appears half circle like this.</p>

<p><img src="https://forum.processing.org/two/uploads/imageupload/864/K7SQ875P3WJ5.png" alt="スクリーンショット 2017-02-25 13.23.14" title="スクリーンショット 2017-02-25 13.23.14" /></p>

<p>I understand
arc(x,y,width,height,start,stop);</p>

<p>Why start and stop are the same arguments but half circle appears?</p>
]]></description>
   </item>
   <item>
      <title>What's wrong with my hue gradient?</title>
      <link>https://forum.processing.org/two/discussion/19913/what-s-wrong-with-my-hue-gradient</link>
      <pubDate>Sun, 25 Dec 2016 11:31:00 +0000</pubDate>
      <dc:creator>appas</dc:creator>
      <guid isPermaLink="false">19913@/two/discussions</guid>
      <description><![CDATA[<p>Hi,
I'm trying to make a gradient around a circle, so that one rotation around the circle would be one lap of the hue wheel. It seems to work fine when I try it out as a linear gradient (the rects in the following code), but I can't get it to wrap around the circle.</p>

<pre><code>    void setup()
    {
      colorMode(HSB, 360, 100, 100);
      background(100, 0, 100);
      ellipseMode(RADIUS);
      noFill();
      frame.setResizable(true);
    }

    void draw()
    {
      float R = 200;
      clear();
      for (int i = 0; i &lt; 360; i++)
      {
        stroke(i, 100, 100);
        rect(5*i, 50, 5, 5);
      }
      pushMatrix();
      translate(width/2, height/2);
      strokeWeight(5);
      int FINE = 360*3;
      for (int i = 0; i &lt; FINE; i++) {
        println(i + ", " + float(i)/FINE*360);
        stroke(float(i)/FINE*360, 100, 100);
        arc(-R/2, 0, R/2, R/2, 0, PI);
        rotate(2*PI*float(i)/FINE);  
      }
      popMatrix();
      //strokes
      strokeWeight(4);
      stroke(0, 0, 0);
      ellipse(width/2, height/2, R, R);
      translate(width/2, height/2);
      arc(-R/2, 0, R/2, R/2, 0, PI);
      rotate(2*PI/3);
      arc(-R/2, 0, R/2, R/2, 0, PI);
      rotate(2*PI/3);
      arc(-R/2, 0, R/2, R/2, 0, PI);

    }
</code></pre>

<p><img src="http://i.imgur.com/OyNJFWn.png" alt="" /></p>
]]></description>
   </item>
   <item>
      <title>Im trying to make a arc rotate at a fixed point in the center around my mouse. pls help?</title>
      <link>https://forum.processing.org/two/discussion/19591/im-trying-to-make-a-arc-rotate-at-a-fixed-point-in-the-center-around-my-mouse-pls-help</link>
      <pubDate>Wed, 07 Dec 2016 23:18:52 +0000</pubDate>
      <dc:creator>Garnuk</dc:creator>
      <guid isPermaLink="false">19591@/two/discussions</guid>
      <description><![CDATA[<p>My code is pretty bad so it would be pointless to post it. Thx for your help.</p>
]]></description>
   </item>
   <item>
      <title>Divide a circle into equal parts</title>
      <link>https://forum.processing.org/two/discussion/19582/divide-a-circle-into-equal-parts</link>
      <pubDate>Wed, 07 Dec 2016 16:22:09 +0000</pubDate>
      <dc:creator>dapilk</dc:creator>
      <guid isPermaLink="false">19582@/two/discussions</guid>
      <description><![CDATA[<p>How do I divide a circle into equal points?</p>
]]></description>
   </item>
   <item>
      <title>How to detect when mouse is within arc?Help!</title>
      <link>https://forum.processing.org/two/discussion/19334/how-to-detect-when-mouse-is-within-arc-help</link>
      <pubDate>Sun, 27 Nov 2016 18:30:52 +0000</pubDate>
      <dc:creator>MyName</dc:creator>
      <guid isPermaLink="false">19334@/two/discussions</guid>
      <description><![CDATA[<p>Hi,</p>

<p>I have been trying to figure out how to detect if my mouse (mouseX and mouseY) are within an arc. Its easy to do for something like a rectangle, where you can just specify the outside boundaries for the width and height in an "if" statement. But how can we do that for an irregular object with a curve in it, such as for an arc? 
I was thinking of something like a for loop where, since you have a slope of 1, the x and y should correspond in some way. But just comparing along the hypotenuse is too small of a detection range, and a for loop is resource intensive to do continually. I would need it to detect the mouse if it is anywhere within the arc, not just the outer border. 
I'm a newcomer to programming, so I would appreciate to keep things on the simpler side. Thank you!</p>

<p>Any ideas?</p>

<pre><code>void setup()
{
  size(400,400);
  arc(0,0, 80, 80, 0, TWO_PI);
}

void loop ()
{
  background(140);

  //if(mouseX and mouseY are in the arc, then print something
}
</code></pre>

<p>Better yet, how can we detect if the mouse, or anything else for that matter, goes through that narrow opening for the arc, and goes into the arc, as displayed in the picture?</p>

<p><img src="https://forum.processing.org/two/uploads/imageupload/790/56BB0K0J3RUB.PNG" alt="Image 1" title="Image 1" /></p>
]]></description>
   </item>
   <item>
      <title>transitioning shapes</title>
      <link>https://forum.processing.org/two/discussion/18453/transitioning-shapes</link>
      <pubDate>Sat, 08 Oct 2016 04:29:22 +0000</pubDate>
      <dc:creator>wjsandbe</dc:creator>
      <guid isPermaLink="false">18453@/two/discussions</guid>
      <description><![CDATA[<p>I'm trying to use mouseClicked to make these arcs move to the top right corner and shrink in size. I momentarily had it, but lost it while trying to add something else haha.</p>

<pre><code>    void setup(){
      fullScreen();

    }
    int x1 = 0;
    int x2 = 0;
    int y1 = 0;
    int y2 = 0;


    void draw(){  
     x1 = width/2;
     x2 = 600;
     y1 = height/2;
     y2 = 600;

       stroke(0);
      strokeWeight(5);
      fill(0);
      arc(x1, y1, x2, y2, PI, PI*3.25); //Arc1

  stroke(0);
      strokeWeight(5);
      fill(#FFF700);
      arc(x1, y1, x2, y2, PI*2.25, PI*2.75);//Arc2

 fill(#FF0000);
       stroke(0);
      strokeWeight(5);
      arc(x1, y1, x2, x2, PI*2.75, PI*3.25);//Arc3

stroke(0);
      strokeWeight(5);
      fill(#FFFFFF);
      arc(x1, y1, x2, y2, TWO_PI-PI/4, PI*2.25);//Arc4
    }

    void mouseclicked(){
        x1 = (width/3 + (width/3 + width/4));
      y1 = height/3;
      x2 = 80;
      y2 = 80;
    }
</code></pre>
]]></description>
   </item>
   <item>
      <title>Adding tick marks to arc function</title>
      <link>https://forum.processing.org/two/discussion/17380/adding-tick-marks-to-arc-function</link>
      <pubDate>Fri, 01 Jul 2016 05:58:24 +0000</pubDate>
      <dc:creator>djklitz</dc:creator>
      <guid isPermaLink="false">17380@/two/discussions</guid>
      <description><![CDATA[<p>Hi guys. I'm pretty new to processing. Frankly I've never used a graphics software before so a lot of this is new to me.</p>

<p>I'm trying to use the arc() function but I want to make a semi-circle with a dashed or "tick'ed" border. I'm trying to make a digital gauge that is ticked based similar to an AEM digital gauge.</p>

<p>I could make a ton of arc()'s for each tick but that feels like a lot of processing power. Or I could make a colored background image and a single black arc() that works in reverse that covers the colored portion.</p>

<p><img src="http://www.qube-engineering.com/Referenced/AP2_Multicolor_Front_03.jpg" alt="" /></p>

<p>The RPM gauge is a good example of what I'm trying to build.</p>

<p>I've currently got a full arc() working as a gauge but I want to add tick marks.</p>
]]></description>
   </item>
   <item>
      <title>I wrote an arc() method that might make lives easier</title>
      <link>https://forum.processing.org/two/discussion/17371/i-wrote-an-arc-method-that-might-make-lives-easier</link>
      <pubDate>Thu, 30 Jun 2016 16:25:53 +0000</pubDate>
      <dc:creator>iMakeRobots</dc:creator>
      <guid isPermaLink="false">17371@/two/discussions</guid>
      <description><![CDATA[<p><a href="https://www.marginallyclever.com/2016/06/creating-processing-arc-method/" target="_blank" rel="nofollow">https://www.marginallyclever.com/2016/06/creating-processing-arc-method/</a></p>

<p><a href="https://github.com/i-make-robots/drawArcs" target="_blank" rel="nofollow">https://github.com/i-make-robots/drawArcs</a></p>

<p>Designed to closely resemble the gcode G02 an G03 commands.  The above sketch includes visualization routines.</p>

<p>void drawArc(float sx,float sy,float ex,float ey,float cx,float cy,boolean cw)</p>

<p>arc starts at (sx,sy)
arc ends at (ex,ey)
arc center is at (cx,cy)
arc direction around center is clockwise if cw=true</p>

<p>start-center does not have to be the same distance as end-center, so sections of ellipses are easy to draw.</p>

<p>I hope you find this useful.  Enjoy!</p>
]]></description>
   </item>
   <item>
      <title>Performance drop when using arc() in android mode</title>
      <link>https://forum.processing.org/two/discussion/17194/performance-drop-when-using-arc-in-android-mode</link>
      <pubDate>Sat, 18 Jun 2016 03:03:47 +0000</pubDate>
      <dc:creator>sparkyjohn</dc:creator>
      <guid isPermaLink="false">17194@/two/discussions</guid>
      <description><![CDATA[<p>I'm tying to create a HUD for a game, and as part of that, I would like to have arcs representing shields, armor etc. However when I attempt to use arc(), the frame rate drops to around 10, but when I disable them, I get around 35. Has anyone else experienced this or found a fix? I've thought about using curves, but they seem to be a lot of trouble and would make the coding much more complex as they are not meant to be circular sections like arcs. Any suggestions or help would be greatly appreciated!
--My phone is running Marshmallow 6.0.1 and I'm using Processing 3.1.1--</p>
]]></description>
   </item>
   <item>
      <title>How can i replace a pixel color?</title>
      <link>https://forum.processing.org/two/discussion/17068/how-can-i-replace-a-pixel-color</link>
      <pubDate>Thu, 09 Jun 2016 17:10:47 +0000</pubDate>
      <dc:creator>Toust</dc:creator>
      <guid isPermaLink="false">17068@/two/discussions</guid>
      <description><![CDATA[<p>I have a sketch, in wich I overlay some shapes with opacity. Is there a way to tell the program to replace the pixel color generated from the overlay, with a new color?</p>
]]></description>
   </item>
   <item>
      <title>using multiple arcs but the result looks</title>
      <link>https://forum.processing.org/two/discussion/17002/using-multiple-arcs-but-the-result-looks</link>
      <pubDate>Sun, 05 Jun 2016 23:08:04 +0000</pubDate>
      <dc:creator>flowen</dc:creator>
      <guid isPermaLink="false">17002@/two/discussions</guid>
      <description><![CDATA[<p>So I'm trying to basically draw an ellipse with gaps in between the arcs, but the results I'm getting look very ugly. Is this a bug or am I doing something wrong? I get these results in p5 but in processing as well, especially the smaller it is, the uglier. I thought smooth() would fix it, but it sometimes makes it worse.</p>

<p>these are some of the results:</p>

<p><img src="https://forum.processing.org/two/uploads/imageupload/973/NJL6XZYC3OLJ.png" alt="Screen Shot 2016-06-06 at 01.04.33" title="Screen Shot 2016-06-06 at 01.04.33" />
<img src="https://forum.processing.org/two/uploads/imageupload/588/QFZB1MQESKKD.png" alt="Screen Shot 2016-06-06 at 01.04.52" title="Screen Shot 2016-06-06 at 01.04.52" /></p>

<p>code:</p>

<pre><code>void setup() {
  size(600,600);
}

void draw() {
  noFill();
  translate(width/2, height/2);
  drawEyeArcs(0,0, 50, 12);
}

void drawEyeArcs(int x, int y, int size, int segments) {

    // we draw double the segments, because we want to skip each odd one
    segments *= 2;

    for (int i = 0; i &lt; segments; i++) {
        if (i % 2 == 1) {
            float start = TWO_PI / segments * i;
            float end = TWO_PI / segments * (i + 1);
            arc(0, 0, size, size, start, end);
        }
    }
}
</code></pre>
]]></description>
   </item>
   <item>
      <title>Pie graph help</title>
      <link>https://forum.processing.org/two/discussion/16642/pie-graph-help</link>
      <pubDate>Mon, 16 May 2016 13:50:09 +0000</pubDate>
      <dc:creator>cricketplayer</dc:creator>
      <guid isPermaLink="false">16642@/two/discussions</guid>
      <description><![CDATA[<p>hi i want to add this pie graph that turns into an circle into my main sketch but i want to be able to click once and the pie graph turns into a circle and when i put it it doesn't work. Could someone pls help me put this into my main sketch and tell me how to use the mousePressed function so that i click once and the graph turns into a circle<br />
thanks</p>

<pre><code>int arcsize=600;
int shrinkorgrow;

 int diameter = 300;
 int[] angle2 = {70,60,100,60,70};
  float lastangle2 = 0;
int i=0;
void setup(){
  size(1000,1000);
  frameRate(5);
}



void draw() {
  //check the size of arc
  if(arcsize&gt;299){
    shrinkorgrow=0;
  }else if (arcsize&lt;101){
    shrinkorgrow=1;
  }arc(width/2, height/2, diameter, diameter, lastangle2, lastangle2+radians(angle2[i]));
 lastangle2 += radians(angle2[i]);  
  fill(9,123,178) ;
      }
</code></pre>
]]></description>
   </item>
   <item>
      <title>Collision between Objects</title>
      <link>https://forum.processing.org/two/discussion/16534/collision-between-objects</link>
      <pubDate>Wed, 11 May 2016 00:56:35 +0000</pubDate>
      <dc:creator>HoweverIronic</dc:creator>
      <guid isPermaLink="false">16534@/two/discussions</guid>
      <description><![CDATA[<p>I want to make my ellipse disappear when colliding with the walls of the maze (which are made up of arcs). Any tips?</p>

<p>Here's the code:</p>

<pre><code>//Up to increase number of levels
//Down to decrease number of levels

int a=500;


void setup() {
  size(550,500);
}

int nlevels=5;
int ellipse=5;


void draw() {
  translate(0,20);
  background(255);
  noFill();



  if (nlevels&lt;33) {
      strokeWeight(3);
    }
    else if  (nlevels&lt;50) {
      strokeWeight(2);
    }
    else {
      strokeWeight(1);
    }
  print(nlevels);
  float dist=a/nlevels*0.8;
  //1
  line(a/2,(a/2)-dist/2,a/2,(a/2)+dist/2);
  line((a/2)-dist/2,a/2,(a/2)+dist/2,a/2);
  //2
  arc(a/2+dist/4,a/2-dist/2,dist/2,dist/2,PI,TWO_PI);
  for (int i=0;i&lt;nlevels;i++) {
    arc(a/2-dist/2,a/2-dist/2,(dist*i),(dist*i),PI/2,PI);
    arc(a/2+dist/4,a/2-dist/2,(1.5*dist)+(dist*i),(1.5*dist)+(dist*i),PI,TWO_PI);
    arc(a/2+dist/2,a/2-dist/2,dist+(dist*i),dist+(dist*i),0,HALF_PI);
    line(a/2,(a+dist*(i-1))/2,a/2,(a+dist*i)/2);
    if (i%2==0) {
      if (i!=nlevels-1) {
        line(a/2-dist/2,a/2+(i*dist/2),a/2+dist/2,a/2+(i*dist/2));
      } else {
        line(a/2,(a+dist*i)/2,a/2+dist/2,(a+dist*i)/2);
      }
    }
  }

  fill(0);
  ellipse(mouseX,mouseY,20,20);

}

void keyPressed() {
  if (key == CODED) {
    switch (keyCode) {
      case UP:
      nlevels=min(83,nlevels+1);
      ellipse=min(83,ellipse+1);
      break;
      case DOWN:
      nlevels=max(5,nlevels-1);
      ellipse=max(5,ellipse-1);
      break;
    }
  }
}
</code></pre>
]]></description>
   </item>
   <item>
      <title>possible to check if two arc's intersect?</title>
      <link>https://forum.processing.org/two/discussion/16495/possible-to-check-if-two-arc-s-intersect</link>
      <pubDate>Sun, 08 May 2016 19:22:27 +0000</pubDate>
      <dc:creator>ottenm</dc:creator>
      <guid isPermaLink="false">16495@/two/discussions</guid>
      <description><![CDATA[<p>Subject says it all.  I'm drawing a number of arc's like this:</p>

<pre><code>arc(x1, y1, w1, h1, start1, stop1, PIE);
arc(x2, y2, w2, h2, start2, stop2, PIE);
</code></pre>

<p>... and I'd like to find out before I draw them if the arcs intersect/overlap/share pixels (using these terms synonymously).  It's not enough to check the two ellipses because the ellipses can overlap long before the arcs overlap.</p>

<p>Would prefer some nice elegant math, but I do have one duct-tape idea:<br />
Draw both arcs to some kind of off screen buffer using semi-transparent fill colors, then scan the buffer for pixels colored to reflect an overlap.  Big buffer, so probably check the ellipses first, then just check pixels within the ellipses somehow.</p>

<p>Very grateful for any suggestions!</p>
]]></description>
   </item>
   <item>
      <title>Cut out a shape of another</title>
      <link>https://forum.processing.org/two/discussion/16068/cut-out-a-shape-of-another</link>
      <pubDate>Sun, 17 Apr 2016 19:32:22 +0000</pubDate>
      <dc:creator>Rumbleball</dc:creator>
      <guid isPermaLink="false">16068@/two/discussions</guid>
      <description><![CDATA[<p>I want to create a parachute simply using the given shapes. I draw using arc() and cut out using ellipse(). This works great if there is only one image on the screen at a given time. The problem is, there can be more of these parachutes on the screen. Because the cut out is just an ellipse in background color, it will draw over parachutes in the background.</p>

<p>I need to cut the ellipse() out, but have the region to be transparent afterwards. (substract, cut out, delete region, what ever you would call it).</p>

<p>Is there an easy way to achive this task? The arc()s shall have different colors. What would I look for?</p>

<pre><code>PGraphics parachute;

 void setup()
 {

  size(800,800);
   background(0);

   parachute = createGraphics(500,500);
   parachute.beginDraw();
   parachute.fill(255,0,0);
   parachute.arc(250,250,400,200, radians(180), radians(250));
   parachute.fill(0,255,0);
   parachute.arc(250,250,400,200, radians(250), radians(290));
   parachute.fill(0,0,255);
   parachute.arc(250,250,400,200, radians(290), radians(360));

   //cutout
   parachute.fill(0);
   parachute.ellipse(250,250,400,170);

   parachute.endDraw();

 }

void draw()
{
  image(parachute,200,200);
  image(parachute,150,100);

}
</code></pre>
]]></description>
   </item>
   <item>
      <title>Pixel sorting: Arranging all the pixels from an image in a color wheel. Is it possible?</title>
      <link>https://forum.processing.org/two/discussion/15164/pixel-sorting-arranging-all-the-pixels-from-an-image-in-a-color-wheel-is-it-possible</link>
      <pubDate>Sat, 27 Feb 2016 21:50:02 +0000</pubDate>
      <dc:creator>rmbrown</dc:creator>
      <guid isPermaLink="false">15164@/two/discussions</guid>
      <description><![CDATA[<p>I am new to Processing, and I have done quite a lot of searching, but I dont seem to be getting anywhere. My objective is to take all the colours from an image, and arrange them by hue in a colour wheel. I presume the result will represent a pie chart more than an actual spectrum, but that's ok.</p>

<p>I am a designer not a programmer, so integers and arrays are a little alien to me. I have however got code from the GENERATIVE DESIGN book which I thought might work:
<a href="http://www.generative-gestaltung.de/P_1_1_2_01" target="_blank" rel="nofollow">http://www.generative-gestaltung.de/P_1_1_2_01</a> for a colour spectrum, 
<a href="http://www.generative-gestaltung.de/P_1_2_2_01" target="_blank" rel="nofollow">http://www.generative-gestaltung.de/P_1_2_2_01</a> which loads the colour pixels from the image, however does not really arrange them, and uses the mouse x, y coords to tile the colours. It does seem to group similar hues together, which is perfect.</p>

<p>I think what I need is some kind of a cross between these two projects. So firstly, is something like this possible?
And if so, am I looking in the right place?
Thanks in advance.
R</p>
]]></description>
   </item>
   <item>
      <title>How to appear a line not draw?</title>
      <link>https://forum.processing.org/two/discussion/15690/how-to-appear-a-line-not-draw</link>
      <pubDate>Fri, 25 Mar 2016 17:09:22 +0000</pubDate>
      <dc:creator>Ivan_wong</dc:creator>
      <guid isPermaLink="false">15690@/two/discussions</guid>
      <description><![CDATA[<p>I am the new one of using processing, I just want to know is there any sample way that I can not only draw a line on processing but also I can appear a line from point A to point B and then stop after I press the run button.</p>

<p>Is there any way that I can appear a arc just like the appear the line?</p>

<p>Thank a lot！
sorry for my poor processing knowledge and my poor english..</p>
]]></description>
   </item>
   </channel>
</rss>