Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 08:08 23 Jul 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : [Help] MMBasic and Inverse Functions

Author Message
Yourock17
Newbie

Joined: 09/01/2015
Location: Australia
Posts: 12
Posted: 09:25pm 14 Aug 2015
Copy link to clipboard 
Print this post

Hello, on MMBasic ver. 4.01 is there a way to do trigonometric inverse functions. I am currently trying to use MMBasic to find the angle of a right-angled triangle with the length of two sides on my Colour Maximite. I have read through the manual, but nothing seems to reveal. I then started trying codes that just crashed my program, such as:

TAN(Opposite/Adjacent)^-1


Help would be very very appreciated
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6274
Posted: 09:57pm 14 Aug 2015
Copy link to clipboard 
Print this post

That's an old version od MM Basic you are using but ATN has been available for a long time.

From the manual:
ATN( number ) Returns the arctangent value of the argument 'number' in radians.

If you need the other inverse trig functions, you can create your own functions:


FUNCTION ASIN(x)
ASIN=2*ATN(x/(1+SQR(1-x*x)))
END FUNCTION

FUNCTION ACOS(x)
ACOS=1.5708- ASIN(x)
END FUNCTION


Jim
VK7JH
MMedit
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025