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.

Program Announcements / Coming Soon : Get the value of PI

Author
Message
MrTAToad
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 23rd Dec 2002 14:00
Yes - get the value of PI (3.14159265358979) into your programs...
Good news everyone! I really am THAT good...
Oh my, yes...
Rob K
Retired Moderator
22
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 23rd Dec 2002 16:14
MrTAToad, put this in Beta announcements.

NOBODY has a forum name as stupid as Darth Shader. I do.
Rob K
Retired Moderator
22
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 23rd Dec 2002 16:16
I can do that easily enough anyway

Pi# = 22/7

Isn't a DLL function therefore pointless?

NOBODY has a forum name as stupid as Darth Shader. I do.
Rob K
Retired Moderator
22
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 23rd Dec 2002 16:19
Hmm... OK, maybe not.

It should work but for some reason it gives 3 instead of 3.14...

NOBODY has a forum name as stupid as Darth Shader. I do.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 23rd Dec 2002 17:23
You forgot to make the compiler do floating point arithmetic.

This is a better approximation - good enough for most things.

Pi#=1833616417.0/583658233.0
haggisman
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 23rd Dec 2002 17:27
IanM i think you are being a bit too accurate

Specs:- 1GHZ athlon, Radeon8500, 192mb ram, winxp
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 23rd Dec 2002 17:44
Oh, sorry. I'll try an rein myself in a bit.
MrTAToad
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 23rd Dec 2002 18:32
Why put it in Beta announcements when its availiable now ?

Good news everyone! I really am THAT good...
Oh my, yes...
Kale
22
Years of Service
User Offline
Joined: 8th Sep 2002
Location: United Kingdom
Posted: 23rd Dec 2002 19:57
why not just use:


What the flame does not consume, consumes the flame.
------------------------------------------------------------------------
AMD XP2100+, Geforce4Ti 4400, 512Mb DDR, Abit KX7, WinXP Home
Kale
22
Years of Service
User Offline
Joined: 8th Sep 2002
Location: United Kingdom
Posted: 23rd Dec 2002 20:00
or for a little more precision:


What the flame does not consume, consumes the flame.
------------------------------------------------------------------------
AMD XP2100+, Geforce4Ti 4400, 512Mb DDR, Abit KX7, WinXP Home
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 23rd Dec 2002 20:04
Coz most of it will be dropped. Floats are guaranteed to keep 7 digits, and double floats keep 15 digits (both can keep 1 or 2 more if you're lucky).

Big number though!
QuothTheRaven
22
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: United States
Posted: 23rd Dec 2002 21:49
22/7 is a terrible approximation. And dont forget to add a # to your variable name otherwise it only returns intigers.
haggisman
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 23rd Dec 2002 22:24
3.2 is a good enough approximation, better yet just use 3

Specs:- 1GHZ athlon, Radeon8500, 192mb ram, winxp
Rob K
Retired Moderator
22
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 24th Dec 2002 00:06
@MrTAToad

If it is available now then why did you prefix your post with "Coming Soon"?

Also, it would be really helpful if you put your website address in your sig

NOBODY has a forum name as stupid as Darth Shader. I do.
MrTAToad
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 24th Dec 2002 00:11
Why put it in my signature when the www button will take you to my web site - there is no point in duplicating everything.

Its labelled 'Coming Soon' because it depends on when I update my web site.

Good news everyone! I really am THAT good...
Oh my, yes...
heartbone
22
Years of Service
User Offline
Joined: 9th Nov 2002
Location:
Posted: 24th Dec 2002 01:20
From back in the day, I came up with this
IT WILL MEET ALL YOUR NEEDS.

heartbone
22
Years of Service
User Offline
Joined: 9th Nov 2002
Location:
Posted: 24th Dec 2002 01:21
355/113
float values
kc9yankee
21
Years of Service
User Offline
Joined: 5th Jan 2003
Location:
Posted: 6th Jan 2003 07:00
You can simply use trigonometry to get the exact value of PI.

Examples:

rem The angle corresponding to an
rem x-coordinate(cosine) on the unit
rem circle is PI.

PI# = acos(-1)

You can use arc tangent too, except there is no direct value that gives a value of PI because the tangent curve is not defined at PI. You can, however, get a value like PI/4 then multiply by 4 to get PI.

PI/4 = atan(1)

Thus,

PI# = atan(1) * 4

These are exact values for PI, obtained without having to hard code.

NOTE: PI = asin(0), BUT asin(0) also equals 0, 2PI, 3PI, 4PI...and so on, so it may not be reliable. I have not tested asin(0) in DB yet, but in C++ asin(0) = 0, generally, as it could change from compiler to compiler.

MrTAToad
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 6th Jan 2003 10:22
That is processor intensive.

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
heartbone
22
Years of Service
User Offline
Joined: 9th Nov 2002
Location:
Posted: 10th Jan 2003 02:31
(355/113)- PI = 2.667e-7 or .0000002667
Good enough for 99.9999 % of calculations.
No need for anything else.

REMEMBER.... 355/113

The more you see, the more you know.
The more you know, the more you see.
MrTAToad
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 10th Jan 2003 19:53
or use MY plug-in

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
Rob K
Retired Moderator
22
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 12th Jan 2003 19:28
"or use MY plug-in"

Too much work. 355/113 is easier.

NOBODY has a forum name as stupid as Darth Shader. I do.
MrTAToad
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 12th Jan 2003 19:58
But then you either have to include a .dba file each time you want PI or you have to type it in each time...

Besides, my plug-in saves you 2/3 characters...

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
Rob K
Retired Moderator
22
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 12th Jan 2003 22:04
"But then you either have to include a .dba file each time you want PI or you have to type it in each time...

Besides, my plug-in saves you 2/3 characters..."

355/113 is easier to type in every time than downloading the plugin and installing it. Besides 355/113 vs Pi(), a difference of THREE characters!

Why don't you release all your maths function is ONE plugin ?! - It doesn't hurt as they take up very little space.

NOBODY has a forum name as stupid as Darth Shader. I do.
MrTAToad
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 13th Jan 2003 11:01
All my maths routines are in one plug-in, duh!

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 13th Jan 2003 20:32
Blimey! Is this thread still alive?
MrTAToad
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 14th Jan 2003 00:11
Too right - no one can beat the power of PI()

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 16th Jan 2003 00:50
'Blimey! Is this thread still alive?'

yeah, apart from the fact that MrTAToad wont shut up

joke

xxxpetratxxx
B. R. W
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 16th Jan 2003 00:52
smiley test..

:-A
:-B
:-C

:-E
:-F
:-G
:-H
:-I
:-J
:-K
:-L
:-M
:-N

:-P
:-Q
:-R

:-T
:-U
:-V
:-W
:-X
:-Y
:-Z

xxxpetratxxx
B. R. W
MrTAToad
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 16th Jan 2003 00:53
You dont have PI() in there though...

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 16th Jan 2003 00:53
:-&
:-é
:-"
:-'
:-(
:--
:-è
:-_
:-à


:-|
:-\

xxxpetratxxx
B. R. W
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 16th Jan 2003 00:54
get over it

xxxpetratxxx
B. R. W
MrTAToad
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 16th Jan 2003 00:58
Still no _PI() in there...

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
Ordos0
21
Years of Service
User Offline
Joined: 14th Jan 2003
Location:
Posted: 29th Jan 2003 18:07
smiley test cont'd


:-i
:-a
:-x

>-O

Ordos0
21
Years of Service
User Offline
Joined: 14th Jan 2003
Location:
Posted: 29th Jan 2003 18:08
:-p
:-q

MrTAToad
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 29th Jan 2003 18:48
Oi! This is for the serious discussion of _PI()...






Dont forget to use it!

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
Arrow
21
Years of Service
User Offline
Joined: 1st Jan 2003
Location: United States
Posted: 30th Jan 2003 03:11
Why not just use pi# = 3.14?

Am I a butterfly dreaming I'm a man?
Or a bowling ball dreaming I'm a plate of samishi?
Never assume that what you see or feel is real.
MrTAToad
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 30th Jan 2003 10:18
Because its best to have a constant value and variable name for everyone.

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
PiratSS
22
Years of Service
User Offline
Joined: 18th Oct 2002
Location:
Posted: 1st Feb 2003 01:06
Hmm another PI discussion.

There was one long time ago on Real Game Tools forums.

I think I would agree with arrow, because I don't think it means much of difference in the game.

Specs: Dual Amd Athlon 2Ghz(1Ghz x 2), 40GB 15000 Rpm SCSI Hard Drive, 640 Mb 266Mhz DDR, 12x8x32 CDRW, ATI Rage Fury Pro 32Mb SD Video, 17' Monitor, Hi-Speed Internet
MrTAToad
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 1st Feb 2003 13:33
Saves having to type out the number each time though..

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
John H
Retired Moderator
22
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 2nd Feb 2003 05:25
Id use whatever is fast and accurate, but thats what we are debating

For smileys just go here http://www.darkbasicpro.com/apollo/smilies.html

RPGamer

Current - RPG: Eternal Destiny : Help Wanted!
http://www.halbrosproductions.netfirms.com
Dont ask those questions! Read the help files lazy!
MrTAToad
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 2nd Feb 2003 10:37
Plus _PHI() and its family wont change between user & user or program & program.

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
Bluedeep
21
Years of Service
User Offline
Joined: 3rd Feb 2003
Location: Finland
Posted: 4th Feb 2003 09:17
Why not just use 3.141 or 355,113.
i use functions, i have one Dba-file that includes many functions that make programming faster.
one of these functions contains exact value of Pi.

MrTAToad
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 4th Feb 2003 10:24
Dont you people read ? See above the advantages of using _PHI() instead of having to hand-code it.

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
Arrow
21
Years of Service
User Offline
Joined: 1st Jan 2003
Location: United States
Posted: 5th Feb 2003 04:01
Um, Mr. MrTAToad, I do admit your a great programer and every thing but have you feeling ok? It's only pi. I think all the DLL making has taken it's toll on you. Get some rest, don't worry about those men in white coats, they won't hurt you. Everything is going to be ok.

Am I a butterfly dreaming I'm a man?
Or a bowling ball dreaming I'm a plate of samishi?
Never assume that what you see or feel is real.
MrTAToad
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 5th Feb 2003 14:29
'Only' pi? What do you mean 'only' pi ???

Joking aside, the point I'm making is that its best not do try and duplicate anything thats already been done. Aside from the possibility of introducing errors, it saves time...

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
empty
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 5th Feb 2003 14:33
Quote: "
Id use whatever is fast and accurate, but thats what we are debating
"

The fastest way (runtime) is: #constant pi 3.14159265358979

Ogres have layers.
MrTAToad
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 5th Feb 2003 16:21
And do you want to keep having to include it all the time ?

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
empty
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 7th Feb 2003 02:00
Quote: "
And do you want to keep having to include it all the time ?
"


Yup.

Ogres have layers.
Arrow
21
Years of Service
User Offline
Joined: 1st Jan 2003
Location: United States
Posted: 9th Feb 2003 01:17
Don't let him get to ya. The thing that gets me is that you've done some great DLL's before, but this one is so simple. Just kinda threw me off.

Am I a butterfly dreaming I'm a man?
Or a bowling ball dreaming I'm a plate of samishi?
Never assume that what you see or feel is real.

Login to post a reply

Server time is: 2024-11-23 11:49:28
Your offset time is: 2024-11-23 11:49:28