sqrt() \ Language (API) \ Processing 1.0
Author: Casey Reas & Ben Fry
Description: Processing is an electronic sketchbook for developing ideas. It is a context for learning fundamentals of computer programming within the context of the electronic arts.
Keywords: Processing, Processing, Interactive Media, Electronic Arts, Programming, Java, Ben Fry, Casey Reas

Reference for Processing version 1.5. If you have a previous version, use the reference included with your software. If you see any errors or have suggestions, please let us know. If you prefer a more technical reference, visit the Processing Javadoc.

Name | ### sqrt()
Examples |
    noStroke();
    float a = sqrt(6561);  // Sets a to 81
    float b = sqrt(625);   // Sets b to 25
    float c = sqrt(1);     // Sets c to 1
    rect(0, 25, a, 10);
    rect(0, 45, b, 10);
    rect(0, 65, c, 10);
Description | Calculates the square root of a number. The square root of a number is always positive, even though there may be a valid negative root. The square root s of number a is such that s*s = a. It is the opposite of squaring.
Syntax |
    sqrt(value)
Parameters |
value | int or float: non-negative number
Returns | float
Usage | Web & Application
Related | pow() sq()

Updated on August 30, 2010 04:29:39pm EDT