Welcome | spec | C-PLOT | Support | Users | Contact
 
Contents -> Standard User Functions -> calc.4 -> Examples
C-PLOT Manual


C.2.7. - Examples



Create a circle of 101 points, radius 3.
    fn calc.4 n = 101; x = 3 * cos(pi*i/50); y = 3 * sin(pi*i/50)
    


Invert x, set error bars to the square root of y.
    fn . x ^= -1; s = y ^ .5
    
or
    fn . x = 1 / x ; s = sqrt(y)
    


Create a cosine curve of 201 points with x running from -10 to 10 radians.
    fn . n = 201; y = cos(x = -10 + 20 * i / 200)
    


Increment the variable A, and increment each y by 0.2 times A.
    fn .  once A += 1; y += A * 0.2
    
Note the once means A gets incremented once. You can now enter fn . to increase the y values by another step, perhaps repeating this operation to plot a series of curves offset by constant increments.


  Top
  Prev | Next