12.07.2015 Views

GNU Octave - Local Sector 7 web page

GNU Octave - Local Sector 7 web page

GNU Octave - Local Sector 7 web page

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 19: Arithmetic 173[x, y] = pol2cart (theta, r)Function File[x, y, z] = pol2cart (theta, r, z)Function FileTransform polar or cylindrical to cartesian coordinates. theta, r (and z) must be ofsame shape. theta describes the angle relative to the x - axis. r is the distance to thez - axis (0, 0, z).[theta, phi, r] = cart2sph (x, y, z)Function FileTransform cartesian to spherical coordinates. x, y and z must be of same shape.theta describes the angle relative to the x - axis. phi is the angle relative to the xy -plane. r is the distance to the origin (0, 0, 0).[x, y, z] = sph2cart (theta, phi, r)Function FileTransform spherical to cartesian coordinates. x, y and z must be of same shape. thetadescribes the angle relative to the x-axis. phi is the angle relative to the xy-plane. ris the distance to the origin (0, 0, 0).19.7 Mathematical ConstantsIJijBuilt-in VariableBuilt-in VariableBuilt-in VariableBuilt-in VariableA pure imaginary number, defined as √ −1. These built-in variables behave likefunctions so you can use the names for other purposes. If you use them as variablesand assign values to them and then clear them, they once again assume their specialpredefined values See Section 9.3 [Status of Variables], <strong>page</strong> 57.InfinfBuilt-in VariableBuilt-in VariableInfinity. This is the result of an operation like 1/0, or an operation that results in afloating point overflow.NaNBuilt-in VariablenanBuilt-in VariableNot a number. This is the result of an operation like 0/0, or ∞−∞, or any operationwith a NaN.Note that NaN always compares not equal to NaN. This behavior is specified by theIEEE standard for floating point arithmetic. To find NaN values, you must use theisnan function.piBuilt-in VariableThe ratio of the circumference of a circle to its diameter. Internally, pi is computedas ‘4.0 * atan (1.0)’.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!