MathArc(Sin/Cos/Tan) functions.

 

Hey.

Ive been fiddling about with the trigonometric functions in MT4 and have come to a conclusion that the ArcSin, ArcCos and ArcTan functions are really outputting the hyperbole of the individual functions.

Is this true?

Here's how i use them and what i expect:

Right triangle a=1, b=0.5, c. Trying to locate the angle of ac.

Tan-1( b/a ) => Tan-1(0.5/1) = 26.56 degrees (on ms calculator)

Tanh( b/a ) => Tanh(0.5/1) = 0.46 (on ms calculator)

MathArctan( 0.5/1.0 ) = 0.46 in MT4

What i really need is just a inverse MathTan() equal to tan-1 on "regular" calculators.

Hope you can help out.

Filson

 
Is it because it is working in Radians ?
 

filson:

Tan-1( b/a ) => Tan-1(0.5/1) = 26.56 degrees (on ms calculator)

Tanh( b/a ) => Tanh(0.5/1) = 0.46 (on ms calculator)

MathArctan( 0.5/1.0 ) = 0.46 in MT4

Where did you get that number. Using the MS calculator:

Tan(26.560 degrees) = 0.499889

Tan-1(.5)=26.565 degrees=0.463 radians

Tanh-1(0.5) = 0.5493

 
RaptorUK:
Is it because it is working in Radians ?

Yes.

From the documentation: https://docs.mql4.com/math/MathArctan

The MathArctan returns the arctangent of x. If x is 0, MathArctan returns 0. MathArctan returns a value within the range of -π/2 to π/2 radians.

 

WHRoeder youre almost right in following me.

Only that last line "Tanh-1(0.5) = 0.5493" isn't what i found MT to output.

You're right that Tanh-1(0.5) is 0.5493 but i'm not doing the inverse Tanh in MT4.

When you do an Arctan in MT4 you get the result that Tanh on the MS calculator would output.

And in essence i need the inverse tangent to figure out the angle between a and c.

 

filson:

You're right that Tanh-1(0.5) is 0.5493 but i'm not doing the inverse Tanh in MT4.

Only that last line "Tanh-1(0.5) = 0.5493" isn't what i found MT to output.
  1. There are NO Tanh functions in MT4 so how did you get the value that you're not doing?
  2. MathArctan( 0.5/1.0 ) = 0.46 in MT4
    Tan-1(.5)=26.565 degrees=0.463 radians
    The result in MT4 is CORRECT. Go to your calculator and press the radians button
 

Very interesting discussion and thanks for participating!

Thanks for highlighting that the MathArctan() is outputting radians.

Converting back to degrees solves it nicely.

Filson

 
filson:

Very interesting discussion and thanks for participating!

Thanks for highlighting that the MathArctan() is outputting radians.

Converting back to degrees solves it nicely.

Filson

I rather worked with radians. Maybe you have better reasons to work with degrees.
Reason: