Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Environment and Utilities /
Chapter 8 - QuickDraw GX Mathematics / QuickDraw GX Mathematics Reference
Mathematical Functions / Linear and Quadratic Roots


LinearRoot

You can use the LinearRoot function to obtain the root of a linear equation.

long LinearRoot(Fixed first, Fixed last, fract t[]);
first
The first coefficient.
last
The last coefficient.
t
An array of fract numbers. On return, it contains the roots of the equation.
function result
The number of roots of the linear equation. This value may be 0 or 1
(or -1 if all values of t are roots).
DESCRIPTION
The LinearRoot function computes any t between 0 and 1 in which a(1 - t) + bt = 0. The coefficient a is the parameter first. The coefficient b is the parameter last. The function returns the number of roots between 0 and 1.

Any root is returned in the t array, which only needs to hold one value. If both a and b are zero, the function returns the number -1, indicating that a(1 - t) + bt = 0 for all t.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996