header

 

More links

AutoHotkey | Android | Arduino | COMM140Fractals | Grammar Checkers | Knots | A Million Dots Activity |  Processing | Processing for Scratch Users | RedBubble | Tutorials | Weather | World Time Meeting Planner | Favicon Generator.

Home > Tutorials > Processing > Processing Examples > Radiation

Radiation

https://commons.wikimedia.org/wiki/File:Warning_Radiation_v001.png

 

processing code

// Warning RadiationcSign
// https://commons.wikimedia.org/wiki/File:Warning_Radiation_v001.png
// I, the copyright holder of this work, release this work into the public domain. This applies worldwide.
// In some countries this may not be legally possible; if so:
// I grant anyone the right to use this work for any purpose, without any conditions, unless such conditions are required by law.
// by Rupert Russell
// http://www.rupert.id.au/tutorials/processing/examples.php
// Draws a Radiation warning sign based on the template at:
// https://www.osha.gov/OshStd_gif/10ZFZ_10.gif
// A local copy of this template is held on my website at: http://www.rupert.id.au/tutorials/processing/examples/radiation/images/10ZFZ_10.gif
// see the webpage: https://www.osha.gov/pls/oshaweb/owadisp.show_document?p_table=STANDARDS&p_id=10098
// May 30 2014 v001

// The dimentions of this drawing are all based on the radius of the inner circle "A"

  int A = 80;  // radius of inner circle defines the size of the sign and canvas

  int screenWidth = 6 * A;
  int screenHeight = 6 * A;
   
  color bgColor = color(255,255,255);
  PFont font;
  
void setup() {
  size(screenWidth,screenHeight);
  ellipseMode(CENTER); 
  fill(255,0,255);  // Fill with Magenta
  smooth();
  noLoop();
 }


 
void draw() {
  background(255,255,0);
  
  // Define Variables for arcs
  fill(255,0,255);  // Fill with Magenta
  float a = screenWidth /2; // Center arc in canvas
  float b = screenWidth /2; // Center arc in canvas
  float c = 5 * A;
  float d = 5 * A;
  float start;
  float stop;
 
  // Draw arc 1
  start =  radians(-60);
  stop = radians(0);
  arc(a, b, c, d, start, stop, PIE );
  
  // Draw arc 2
  start =  radians(-180);
  stop = radians(-120);
  arc(a, b, c, d, start, stop, PIE );
  
  // Draw arc 3
  start =  radians(-300);
  stop = radians(-240);
  arc(a, b, c, d, start, stop, PIE );
  
  // Draw outer cirlce
  fill(255,255,0);  // Fill with yellow
  noStroke();
  ellipseMode(CENTER);  // Set ellipseMode to RADIUS
  ellipse(screenWidth /2, screenHeight /2, A + A/2, A + A/2);
  
  // Draw inner cirlce
  stroke(0);
  fill(255,0,255);  // Fill with Magenta
  ellipseMode(CENTER);  // Set ellipseMode to RADIUS
  ellipse(screenWidth /2, screenHeight /2, A, A);
  

  // Draw the inner outline of the 3 arcs
  noFill();
  stroke(0);
  c = A + A/2;
  d = A + A/2;
  
  // Draw arc 1
  start =  radians(-60);
  stop = radians(0);
  arc(a, b, c, d, start, stop);
  
  // Draw arc 2
  start =  radians(-180);
  stop = radians(-120);
  arc(a, b, c, d, start, stop );
  
  // Draw arc 3
  start =  radians(-300);
  stop = radians(-240);
  arc(a, b, c, d, start, stop);
   
save("Warning_Radiation_v001.png");
}
code formatter

http://www.onformative.com/codeformatter/

 


 

APA citation:
Russell, R. (2016, July 05, 07:26 am). Radiation.
     Retrieved April 17, 2024, from http://www.rupert.id.au/tutorials/processing/examples/radiation/index.php

Last refreshed: April 17 2024. 09:04.44 am

rupert dot russell at acu dot edu dot au Support Wikipedia

Creative Commons License This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License.


924 visits since May 30, 2014