Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Home
About
Team
Rules
Stats
Status
Sitemap
Chat
Downloads
Forum
News
Our Projects
Major Community Projects
Recent Posts
Unread Posts
Replies
Tools
SourceCoder3
Other Things...
Omnimaga Radio
TI-83 Plus ASM File Unsquisher
Z80 Conversion Tools
IES TI File Editor
Free RAM areas
Comprehensive Getkeyr table
URL Shortener
Online Axe Tilemap Editor
Help
Contact Us
Change Request
Report Issue/Bug
Team
Articles
Members
View the memberlist
Search For Members
Buddies
Login
Register
Omnimaga
»
Forum
»
Calculator Community
»
TI Calculators
»
Axe
(Moderator:
Runer112
) »
Trig Challenge....
« previous
next »
Print
Pages: [
1
]
2
Go Down
Author
Topic: Trig Challenge.... (Read 7187 times)
0 Members and 1 Guest are viewing this topic.
squidgetx
Food.
CoT Emeritus
LV10
31337 u53r (Next: 2000)
Posts: 1881
Rating: +503/-17
rawr.
Trig Challenge....
«
on:
March 27, 2011, 04:20:33 pm »
All right.
We've got an X-velocity (v) , and a Y-velocity (w) that can both get pretty large (ie, past 256). What's the best way to calculate the total speed (a scalar number) while maintaining at least some accuracy? Pythagorean theorem is out because squaring a number greater than 255 will go over our 65535 limit. (If anyone wants to give me assembly hex that's cool too
)
Logged
Read my webcomic!
|
My SoundCloud
Projects:
[url=http://www.omnimaga.org/index.php?topic=5988.msg117813#msg117813]Check out the demo now!
- Current progress: battle engine and stuff
Proud author of:
Cuberunner
|
SpaceDash
|
The Psyche
|
XXEdit
|
AxeSynth
|
StickNinja
|
Gravity Guy
|
Embers:Phoenix
|
Zombie Gun
Axe: Need help optimizing?
User of Axe | zStart | TokenIDE | CalcGS | MirageOS
Ashbad
Guest
Re: Trig Challenge....
«
Reply #1 on:
March 27, 2011, 04:22:21 pm »
Well, does it have to be in some specific format? If not:
W + V
------
2
«
Last Edit: March 27, 2011, 04:22:41 pm by Ashbad
»
Logged
squidgetx
Food.
CoT Emeritus
LV10
31337 u53r (Next: 2000)
Posts: 1881
Rating: +503/-17
rawr.
Re: Trig Challenge....
«
Reply #2 on:
March 27, 2011, 04:23:02 pm »
lol, is that actually a semi-accurate replacement?
edit: err, i don't think so lol
«
Last Edit: March 27, 2011, 04:25:41 pm by squidgetx
»
Logged
Read my webcomic!
|
My SoundCloud
Projects:
[url=http://www.omnimaga.org/index.php?topic=5988.msg117813#msg117813]Check out the demo now!
- Current progress: battle engine and stuff
Proud author of:
Cuberunner
|
SpaceDash
|
The Psyche
|
XXEdit
|
AxeSynth
|
StickNinja
|
Gravity Guy
|
Embers:Phoenix
|
Zombie Gun
Axe: Need help optimizing?
User of Axe | zStart | TokenIDE | CalcGS | MirageOS
Ashbad
Guest
Re: Trig Challenge....
«
Reply #3 on:
March 27, 2011, 04:27:29 pm »
well, like I said, it's not in a specific format. I'll need to know exactly what you're after, if I'm gonna find a solution.
You want average speed, total speed, summed speed, directional speed, sloped speed...?
Logged
squidgetx
Food.
CoT Emeritus
LV10
31337 u53r (Next: 2000)
Posts: 1881
Rating: +503/-17
rawr.
Re: Trig Challenge....
«
Reply #4 on:
March 27, 2011, 04:29:04 pm »
basically, find square root of v^2+w^2 without using that formula.
Logged
Read my webcomic!
|
My SoundCloud
Projects:
[url=http://www.omnimaga.org/index.php?topic=5988.msg117813#msg117813]Check out the demo now!
- Current progress: battle engine and stuff
Proud author of:
Cuberunner
|
SpaceDash
|
The Psyche
|
XXEdit
|
AxeSynth
|
StickNinja
|
Gravity Guy
|
Embers:Phoenix
|
Zombie Gun
Axe: Need help optimizing?
User of Axe | zStart | TokenIDE | CalcGS | MirageOS
Ashbad
Guest
Re: Trig Challenge....
«
Reply #5 on:
March 27, 2011, 04:35:18 pm »
ahh, some form of the distance formula... for speed instead though.
here's one thing to consider, however: the ratio of v + w to sqrt(v^2 + w^2) is roughly .725... . I tested this with many numbers before, so I can safely assure you that
5(v + w)
---------
7
is an extremely fast and accurate subsitute.
EDIT: a slower but even more accurate replacement:
51(v + w)
---------
70
«
Last Edit: March 27, 2011, 04:41:25 pm by Ashbad
»
Logged
squidgetx
Food.
CoT Emeritus
LV10
31337 u53r (Next: 2000)
Posts: 1881
Rating: +503/-17
rawr.
Re: Trig Challenge....
«
Reply #6 on:
March 27, 2011, 04:56:25 pm »
Crap, problem: if y=0 and x=70, then that formula yields 51
I don't think linear representations will be able to do the trick...
Logged
Read my webcomic!
|
My SoundCloud
Projects:
[url=http://www.omnimaga.org/index.php?topic=5988.msg117813#msg117813]Check out the demo now!
- Current progress: battle engine and stuff
Proud author of:
Cuberunner
|
SpaceDash
|
The Psyche
|
XXEdit
|
AxeSynth
|
StickNinja
|
Gravity Guy
|
Embers:Phoenix
|
Zombie Gun
Axe: Need help optimizing?
User of Axe | zStart | TokenIDE | CalcGS | MirageOS
Ashbad
Guest
Re: Trig Challenge....
«
Reply #7 on:
March 27, 2011, 05:00:47 pm »
interesting.. The thing is, why not have 3 different possible equations? One that works for small numbers, one for large ones, and one for sets where one or both answers are 0?
Logged
squidgetx
Food.
CoT Emeritus
LV10
31337 u53r (Next: 2000)
Posts: 1881
Rating: +503/-17
rawr.
Re: Trig Challenge....
«
Reply #8 on:
March 27, 2011, 05:01:32 pm »
That's what I'm doing now lol
Logged
Read my webcomic!
|
My SoundCloud
Projects:
[url=http://www.omnimaga.org/index.php?topic=5988.msg117813#msg117813]Check out the demo now!
- Current progress: battle engine and stuff
Proud author of:
Cuberunner
|
SpaceDash
|
The Psyche
|
XXEdit
|
AxeSynth
|
StickNinja
|
Gravity Guy
|
Embers:Phoenix
|
Zombie Gun
Axe: Need help optimizing?
User of Axe | zStart | TokenIDE | CalcGS | MirageOS
AngelFish
Is this my custom title?
Administrator
LV12
Extreme Poster (Next: 5000)
Posts: 3242
Rating: +270/-27
I'm a Fishbot
Re: Trig Challenge....
«
Reply #9 on:
March 27, 2011, 08:36:40 pm »
Okay, I after a little bit of thinking and some multivariate analysis, the linear function that most closely approximates the function sqrt(x^2+x^2) over the entire interval is 4266.6486024 + 0.70320236774X + 0.67608766999Y. There's some error and the equation probably isn't optimal, but it should be reasonably close to the best possible linear approximation.
Keep in mind that this is over the
entire
interval. There will probably be some oddities near 0.
«
Last Edit: March 27, 2011, 08:38:02 pm by Qwerty.55
»
Logged
∂²Ψ -(2m(V(x)-E)Ψ
--- = -------------
∂x² ℏ²Ψ
Ashbad
Guest
Re: Trig Challenge....
«
Reply #10 on:
March 27, 2011, 09:10:44 pm »
But, also since this will be transferred to code anyways, this might also work as well:
(W*5-(W*5*(W=0))+(V*5-(V*5(V=0)))
--------------------------------------
7
EDIT: and also nice one as well qwerty
«
Last Edit: March 27, 2011, 09:11:13 pm by Ashbad
»
Logged
Xeda112358
they/them
Moderator
LV12
Extreme Poster (Next: 5000)
Posts: 4704
Rating: +719/-6
Calc-u-lator, do doo doo do do do.
Re: Trig Challenge....
«
Reply #11 on:
March 27, 2011, 09:24:38 pm »
Out of curiosity, will the numbers exceed 23169?
Logged
My pastebin
|
Pokémon Amber
|
Grammer Programming Language
|
BatLib Library
|
Jade Simulator
|
Zeda's Hex Opcodes
|
FileSyst Library
|
CopyProg
|
TPROG
|
GroupRead
|
Lbl Read/Write
|
Z80 Floating Point Routines
(
z80float on GitHub
)|
Z80 Optimized Routines Repository
Ashbad
Guest
Re: Trig Challenge....
«
Reply #12 on:
March 27, 2011, 09:25:32 pm »
From what I can guess, probably not, he was testing numbers up to around 3000.
Logged
Xeda112358
they/them
Moderator
LV12
Extreme Poster (Next: 5000)
Posts: 4704
Rating: +719/-6
Calc-u-lator, do doo doo do do do.
Re: Trig Challenge....
«
Reply #13 on:
March 27, 2011, 09:26:37 pm »
Okay, I'll see if I can extend an old algorithm to this, but I don't have high hopes
Logged
My pastebin
|
Pokémon Amber
|
Grammer Programming Language
|
BatLib Library
|
Jade Simulator
|
Zeda's Hex Opcodes
|
FileSyst Library
|
CopyProg
|
TPROG
|
GroupRead
|
Lbl Read/Write
|
Z80 Floating Point Routines
(
z80float on GitHub
)|
Z80 Optimized Routines Repository
Ashbad
Guest
Re: Trig Challenge....
«
Reply #14 on:
March 27, 2011, 09:27:35 pm »
I'm sure you can do it -- if you can't, then the rebellion has lost.
Logged
Print
Pages: [
1
]
2
Go Up
« previous
next »
Omnimaga
»
Forum
»
Calculator Community
»
TI Calculators
»
Axe
(Moderator:
Runer112
) »
Trig Challenge....