BBC BASIC
« Trigonometry Woes... »

Welcome Guest. Please Login or Register.
Jan 23rd, 2018, 4:46pm


Cross-platform BBC BASIC (Win32, Linux x86, Android, Mac OS-X, Raspberry Pi)

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Trigonometry Woes...  (Read 105 times)
jimcroisdale
New Member
Image


member is offline

Avatar




PM


Posts: 4
xx Re: Trigonometry Woes...
« Reply #3 on: Dec 18th, 2017, 4:35pm »

Thankyou for the reply! I've addded that in but it doesnt seem to work.

490 PRINT " Ackermann Angle Calculator"
500 PRINT " **************************"
510 PRINT '
520 INPUT " Enter Distance Between Kingpins in MM: " TRACK
530 INPUT " Enter Distance Between Front and Back Axle in MM: " LONG
540 ADJACENT = TRACK / 2
550 OPPOSITE = LONG
560 HYPO = SQR((ADJACENT*ADJACENT)+(OPPOSITE*OPPOSITE)) REM Pythagoras Bit!
595 ANGLE = ASN(OPPOSITE/HYPO)
600 PRINT ADJACENT
610 PRINT OPPOSITE
620 PRINT HYPO
630 PRINT ANGLE

I'm running the program and entering the sides as 500 and 500. it's working out the hypo to 707 which is right. But then the angle (which should be 45deg) is coming out at 0.785.

Any ideas what I'm doing wrong? smiley
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 692
xx Re: Trigonometry Woes...
« Reply #4 on: Dec 18th, 2017, 4:40pm »

on Dec 18th, 2017, 4:35pm, jimcroisdale wrote:
But then the angle (which should be 45deg) is coming out at 0.785. Any ideas what I'm doing wrong?

Nothing. 0.785 radians is approximately 45 degrees:

Code:
      ANGLE = DEG(ASN(OPPOSITE/HYPO)) 

Richard.
User IP Logged

jimcroisdale
New Member
Image


member is offline

Avatar




PM


Posts: 4
xx Re: Trigonometry Woes...
« Reply #5 on: Dec 18th, 2017, 4:40pm »

Haha, yes! Just figured that out myself! smiley

All working now - thankyou!
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

Donate $6.99 for 50,000 Ad-Free Pageviews!


This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls