Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

processing draw circle

circle(x, y, diameter)
Comment

processing draw circle


void setup() 
{
  size(400, 400);
  background(255,255,255);
}

void draw()
{  
  float step=(2*PI)/120;
  int posX = width/2;
  int posY = height/2;
  float radius = 100;
  int xOld=0, yOld=0;
  for(float theta=0;theta<=(2*PI)+step;theta+=step)
  {
    stroke(0,0,255);
    int x = int(radius*sin(theta) + posX);
    int y = int(radius*cos(theta) + posY);
    if(theta>0)
    {
      line(x,y,xOld,yOld);
    }
    xOld = x;
    yOld = y;
  }

}

Comment

PREVIOUS NEXT
Code Example
Java :: check if string contains numbers 
Java :: java deltaTime 
Java :: Spigot API inventory close 
Java :: libgdx move camera with touch 
Java :: mockito throw exception void method 
Java :: java file reader utf 8 
Java :: java split first occurrence 
Java :: from string to double andoird studio 
Java :: polar to cartesian java 
Java :: android java parse date time 
Java :: find number of days between two local dates in java 8 
Java :: new int [] in java with assigned values 
Java :: java mouselistener get coordinates 
Java :: Why is it not recommended to use script elements in jsp? 
Java :: taking date as input in java 
Java :: double parse jtextfield 
Java :: material design android dependency androidx 
Java :: how to decompose a string into words in Java 
Java :: list to lowercase java 
Java :: Java program to find the sum of all even numbers from 1 to 10 
Java :: android java date from internet 
Java :: nums.add to add the number to the array in java sample 
Java :: java socket get ip address of client 
Java :: add text to jlable 
Java :: android view to bitmap 
Java :: java 11 initialize map 
Java :: infinity constatn in java 
Java :: jackson object to string 
Java :: creating modulu function withou using % java 
Java :: Multiply two Strings Leetcode 
ADD CONTENT
Topic
Content
Source link
Name
3+7 =