Tabnine Logo
PApplet.cos
Code IndexAdd Tabnine to your IDE (free)

How to use
cos
method
in
processing.core.PApplet

Best Java code snippets using processing.core.PApplet.cos (Showing top 11 results out of 315)

origin: org.processing/core

protected void lightSpot(int num, float angle, float exponent) {
 lightSpotParameters[2 * num + 0] = Math.max(0, PApplet.cos(angle));
 lightSpotParameters[2 * num + 1] = exponent;
}
origin: ajavamind/Processing-Cardboard

protected void lightSpot(int num, float angle, float exponent) {
 lightSpotParameters[2 * num + 0] = Math.max(0, PApplet.cos(angle));
 lightSpotParameters[2 * num + 1] = exponent;
}
origin: ajavamind/Processing-Cardboard

/**
 * ( begin auto-generated from PVector_rotate.xml )
 *
 * Rotate the vector by an angle (only 2D vectors), magnitude remains the same
 *
 * ( end auto-generated )
 *
 * @webref pvector:method
 * @usage web_application
 * @brief Rotate the vector by an angle (2D only)
 * @param theta the angle of rotation
 */
public void rotate(float theta) {
 float xTemp = x;
 // Might need to check for rounding errors like with angleBetween function?
 x = x*PApplet.cos(theta) - y*PApplet.sin(theta);
 y = xTemp*PApplet.sin(theta) + y*PApplet.cos(theta);
}
origin: org.processing/core

/**
 * ( begin auto-generated from PVector_rotate.xml )
 *
 * Rotate the vector by an angle (only 2D vectors), magnitude remains the same
 *
 * ( end auto-generated )
 *
 * @webref pvector:method
 * @usage web_application
 * @brief Rotate the vector by an angle (2D only)
 * @param theta the angle of rotation
 */
public PVector rotate(float theta) {
 float temp = x;
 // Might need to check for rounding errors like with angleBetween function?
 x = x*PApplet.cos(theta) - y*PApplet.sin(theta);
 y = temp*PApplet.sin(theta) + y*PApplet.cos(theta);
 return this;
}
origin: org.processing/core

static private void invRotate(PMatrix3D matrix, float angle,
               float v0, float v1, float v2) {
 float c = PApplet.cos(-angle);
 float s = PApplet.sin(-angle);
 float t = 1.0f - c;
 matrix.preApply((t*v0*v0) + c, (t*v0*v1) - (s*v2), (t*v0*v2) + (s*v1), 0,
         (t*v0*v1) + (s*v2), (t*v1*v1) + c, (t*v1*v2) - (s*v0), 0,
         (t*v0*v2) - (s*v1), (t*v1*v2) + (s*v0), (t*v2*v2) + c, 0,
         0, 0, 0, 1);
}
origin: ajavamind/Processing-Cardboard

static private void invRotate(PMatrix3D matrix, float angle,
               float v0, float v1, float v2) {
 float c = PApplet.cos(-angle);
 float s = PApplet.sin(-angle);
 float t = 1.0f - c;
 matrix.preApply((t*v0*v0) + c, (t*v0*v1) - (s*v2), (t*v0*v2) + (s*v1), 0,
         (t*v0*v1) + (s*v2), (t*v1*v1) + c, (t*v1*v2) - (s*v0), 0,
         (t*v0*v2) - (s*v1), (t*v1*v2) + (s*v0), (t*v2*v2) + c, 0,
         0, 0, 0, 1);
}
origin: org.processing/core

float c = PApplet.cos(angle);
float s = PApplet.sin(angle);
origin: ajavamind/Processing-Cardboard

float c = PApplet.cos(angle);
float s = PApplet.sin(angle);
origin: org.processing/core

float cosPhi = PApplet.cos(phi),  sinPhi = PApplet.sin(phi);
 (PApplet.sqrt(4 + 3 * PApplet.sq(PApplet.tan(inc / 2))) - 1) / 3;
float sinPhi1 = PApplet.sin(phi1),  cosPhi1 = PApplet.cos(phi1);
 float sinEta = PApplet.sin(eta),  cosEta = PApplet.cos(eta);
origin: mirador/mirador

float alpha = 200 * ((1 - PApplet.cos(a)) * 0.5f);
pg.fill(color(160, alpha));
pg.noStroke();
origin: mirador/mirador

float corrAlpha = (1 - PApplet.cos(a)) * 0.5f;
boolean selCorrTri = false;
processing.corePAppletcos

Javadoc

( begin auto-generated from cos.xml ) Calculates the cosine of an angle. This function expects the values of the angle parameter to be provided in radians (values from 0 to PI*2). Values are returned in the range -1 to 1. ( end auto-generated )

Popular methods of PApplet

  • constrain
  • createGraphics
    Create an offscreen graphics surface for drawing, in this case for a renderer that writes to a file
  • loadStrings
    ( begin auto-generated from loadStrings.xml ) Reads the contents of a file or url and creates a Stri
  • saveStrings
    ( begin auto-generated from saveStrings.xml ) Writes an array of strings to a file, one line per str
  • abs
  • createImage
    ( begin auto-generated from createImage.xml ) Creates a new PImage (the datatype for storing images)
  • createShape
  • createWriter
    ( begin auto-generated from createWriter.xml ) Creates a new file in the sketch folder, and a PrintW
  • loadImage
  • main
    main() method for running this class from the command line. Usage: PApplet [options] [s
  • max
  • parseInt
  • max,
  • parseInt,
  • random,
  • round,
  • split,
  • sqrt,
  • unhex,
  • arrayCopy,
  • ceil,
  • checkExtension

Popular in Java

  • Finding current android device location
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • setContentView (Activity)
  • compareTo (BigDecimal)
  • Menu (java.awt)
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now