Fixed Point Maths

version 5 by Michael Callaghan

  • Home page
  • Beginning
  • Previous
  • Next



  • Section 8 - Tangents

    To decide what real number is the tangent of (N - a real number):
        let temp1 be the sine of N;
        let temp2 be the cosine of N;
        let result be temp1 real divided by temp2;
        decide on result.

    To decide what real number is the tangent of (N - a number):
        let temp be N as a fixed point number;
        decide on the tangent of temp.

    To decide what real number is the arctangent of (N - a real number):
        if N real equals 0.0000:
            decide on 0.0000;
        if N real equals 1.0000:
            decide on 45.0000;
        if N real equals -1.0000:
            decide on -45.0000;
        let temp be the absolute value of N;
        let result be 1 as a fixed point number;
        if temp is real greater than 1.0000:
            let temp1 be N to the power 2;
            let temp1 be temp1 real plus 0.2809;
            let temp1 be N real divided by temp1;
            let result be 1.5708 - temp1;
        otherwise:
            let temp1 be N real times 0.2809;
            let temp1 be temp1 real times N;
            let temp1 be temp1 real plus 1.0000;
            let result be N real divided by temp1;
        decide on result in degrees.

    To decide what real number is the arctangent of (N - a number):
        let temp be N as a fixed point number;
        decide on the arctangent of temp.