This project is read-only.

Complex

Used for storing complex numbers and also (consider it a language idiom) graph points.

Can be defined in code using the 'i' or 'j' suffix, or using a constructor:

var cpl = 1 + 2i
var other = new complex 1, 2

Operations

Complex values can be subject to arithmetical operations.

Methods

The complex object has the following methods:
  • void construct(float real, float img): constructor taking real and imaginary parts of the number
  • float real: returns the real part
  • float img: return the imaginary part

The class also defines static methods:
  • complex[] merge(float[] reals, float[] imgs): merges two arrays of values into an array of complex values, taking first source array ar real and second as imaginary

Last edited Mar 16, 2011 at 10:14 PM by impworks, version 4

Comments

No comments yet.