Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers AppGameKit Corner / How to get Pi in AGK?

Author
Message
DavidAGK
AGK Developer
10
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 9th Aug 2018 20:25
I recall a command that returns pi (π) in AppGameKit but can't find it for the life of me! Searches are confounded by Rapsberry Pi - anyone know the command?
Using Tier 1 AppGameKit V2
Started coding with AMOS (Thanks Francois Lionet)
DavidAGK
AGK Developer
10
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 9th Aug 2018 21:05
I'm sure I've used a command in the past.... maybe not.
Using Tier 1 AppGameKit V2
Started coding with AMOS (Thanks Francois Lionet)
puzzler2018
User Banned
Posted: 10th Aug 2018 13:33 Edited at: 10th Aug 2018 13:34
Ive never seen one either - so yes - that #constant pi is something you just have to put in your app as there is no in built math function for it



or you could go mad for better precision


lol
puzzler2018
User Banned
Posted: 10th Aug 2018 14:01
Yeah cool - https://www.piday.org/million/

Too many to put in a code tag


I win!!
Bengismo
6
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 10th Aug 2018 14:27 Edited at: 10th Aug 2018 14:31
Using #constant is the correct thing to do

There's no real point in specifying PI past around 7/8 significant places as the digits beyond that cant be represented in a 32bit float variable anyway. They get truncated/rounded.

Uninterestingly, these functions also give PI as well....

PI=ACosRad(0)*2
PI=ASinRad(1)*2
PI=ATanRad(1)*4

All these give 3.141593....via the wonders of trigonometry zzzzzzz
DavidAGK
AGK Developer
10
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 13th Aug 2018 20:16
Very good everyone!
Using Tier 1 AppGameKit V2
Started coding with AMOS (Thanks Francois Lionet)

Login to post a reply

Server time is: 2024-03-29 08:16:26
Your offset time is: 2024-03-29 08:16:26