Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » General Discussions » General Discussion » A math question.
A math question. [message #255878] Thu, 26 April 2007 07:43 Go to next message
jnz is currently offline  jnz
Messages: 3396
Registered: July 2006
Location: 30th century
Karma: 0
General (3 Stars)
This, imo is pretty tricky. It needs to be done, though, I'm hoping a lot of the people on these forums are as smart as they say they are. No, this is not homework or something just to test everyone. It is for a program i am making.

L = (X+S/2)*W/S)-((O*W)/100)

I need to find X when i know L. If someone could do this i would be very grateful.

[Updated on: Thu, 26 April 2007 07:43]

Report message to a moderator

Re: A math question. [message #255879 is a reply to message #255878] Thu, 26 April 2007 07:46 Go to previous messageGo to next message
Genesis2001
Messages: 1397
Registered: August 2006
Karma: 0
General (1 Star)
So....You just need to solve for "X"?


-MathK1LL



EDIT: Got it!

X = 2((S/W)*((O*W/100) + L)) - 2

[Updated on: Thu, 26 April 2007 07:51]

Report message to a moderator

Re: A math question. [message #255881 is a reply to message #255878] Thu, 26 April 2007 07:47 Go to previous messageGo to next message
jnz is currently offline  jnz
Messages: 3396
Registered: July 2006
Location: 30th century
Karma: 0
General (3 Stars)
I need to change the formulae to get X when i know L.
Re: A math question. [message #255883 is a reply to message #255879] Thu, 26 April 2007 07:49 Go to previous messageGo to next message
Genesis2001
Messages: 1397
Registered: August 2006
Karma: 0
General (1 Star)
MathK1LL wrote on Thu, 26 April 2007 08:46

EDIT: Got it!

X = 2((S/W)*((O*W/100) + L)) - 2

[Updated on: Thu, 26 April 2007 07:51]

Report message to a moderator

Re: A math question. [message #255885 is a reply to message #255878] Thu, 26 April 2007 07:51 Go to previous messageGo to next message
mrpirate is currently offline  mrpirate
Messages: 1262
Registered: March 2003
Location: Ontario
Karma: 0
General (1 Star)
X = (S * (L + (O*W)/100))/W + S/2

I think

[Updated on: Thu, 26 April 2007 07:52]

Report message to a moderator

Re: A math question. [message #255887 is a reply to message #255878] Thu, 26 April 2007 07:57 Go to previous messageGo to next message
jnz is currently offline  jnz
Messages: 3396
Registered: July 2006
Location: 30th century
Karma: 0
General (3 Stars)
I tried MathK1ll's and it didn't work. Just trying mrpirate's.

EDIT: mrpirate's didn't work. It looks like it needs half of the total value taken away. but thats just a guess.

[Updated on: Thu, 26 April 2007 08:02]

Report message to a moderator

icon7.gif  Re: A math question. [message #255890 is a reply to message #255878] Thu, 26 April 2007 08:24 Go to previous messageGo to next message
Try_lee is currently offline  Try_lee
Messages: 542
Registered: February 2003
Location: Reading, England
Karma: 0
Colonel
Mr. Pirate was almost right. He should have had -s/2 instead of +s/2.


YARR! The pirate life is for me! http://www.n00bstories.com/image.fetch.php?id=1202408761
Re: A math question. [message #255892 is a reply to message #255878] Thu, 26 April 2007 08:38 Go to previous messageGo to next message
jnz is currently offline  jnz
Messages: 3396
Registered: July 2006
Location: 30th century
Karma: 0
General (3 Stars)
Almost there. the values still need to be a little higher. thanks though Smile

[Updated on: Thu, 26 April 2007 08:40]

Report message to a moderator

Re: A math question. [message #255896 is a reply to message #255878] Thu, 26 April 2007 08:48 Go to previous messageGo to next message
mrpirate is currently offline  mrpirate
Messages: 1262
Registered: March 2003
Location: Ontario
Karma: 0
General (1 Star)
oops

kinda pathetic considering I just wrote a math exam
Re: A math question. [message #255906 is a reply to message #255878] Thu, 26 April 2007 09:32 Go to previous messageGo to next message
Tunaman
Messages: 1190
Registered: January 2005
Karma: 2
General (1 Star)
(S((O - 50)*W + 100L))/100W

http://img694.imageshack.us/img694/9055/tunamanlmao.png
Re: A math question. [message #255910 is a reply to message #255906] Thu, 26 April 2007 09:43 Go to previous messageGo to next message
jnz is currently offline  jnz
Messages: 3396
Registered: July 2006
Location: 30th century
Karma: 0
General (3 Stars)
Ralphzehunter wrote on Thu, 26 April 2007 17:32

(S((O - 50)*W + 100L))/100W



Thanks you soo much In Love In Love In Love . I have been breaking my head over this question for days.

And thank you to everyone else that at least tried.

Just in case everyone was wondering, it is for the SEye. The original formula converts the map coord to the picture coord. this does it the other way round.
Re: A math question. [message #255911 is a reply to message #255878] Thu, 26 April 2007 09:43 Go to previous messageGo to next message
Tunaman
Messages: 1190
Registered: January 2005
Karma: 2
General (1 Star)
No problem. Rocked Over

http://img694.imageshack.us/img694/9055/tunamanlmao.png
Re: A math question. [message #255945 is a reply to message #255878] Thu, 26 April 2007 12:12 Go to previous messageGo to next message
Genesis2001
Messages: 1397
Registered: August 2006
Karma: 0
General (1 Star)
:/


My brain was "math-ed"-out today and this past week.... bleh.


-MathK1LL


P.S.

I'm going to retry the problem again and see though... Smile
Re: A math question. [message #255946 is a reply to message #255878] Thu, 26 April 2007 12:14 Go to previous messageGo to next message
Viking is currently offline  Viking
Messages: 1692
Registered: July 2005
Location: Earth
Karma: 0
General (1 Star)
AHHH! Math my brain hurts... Crazy


Toggle Spoiler


QUOTES
"The Renegade community revolves around having something awesome, and not sharing it so you can be on top of the mountain." -Canadacdn

Crimson wrote on Thu, 17 May 2007 05:22

Memphis wrote on Tue, 15 May 2007 03:54

...fatally die to death...


I don't know if you meant to do that, but triple redundancy for teh win. I LOL'ed.


Awesome l337 people= Icedog90, Blazea58, Canadacdn, Crimson, jonwil
Re: A math question. [message #255966 is a reply to message #255878] Thu, 26 April 2007 13:31 Go to previous messageGo to next message
mrpirate is currently offline  mrpirate
Messages: 1262
Registered: March 2003
Location: Ontario
Karma: 0
General (1 Star)
it's just algebra...
Re: A math question. [message #256631 is a reply to message #255966] Tue, 01 May 2007 10:15 Go to previous messageGo to next message
Jerad2142 is currently offline  Jerad2142
Messages: 3809
Registered: July 2006
Location: USA
Karma: 6
General (3 Stars)
Can anyone give me a formula for how I would calculate what angle an artillery would have to aim at if I knew: gravity, speed of the projectile, distance away the object is from the artillery, height of the object compared to the artillery, and 0 air resistance. This is also for a program, or game more likely *cough*new AI for Renhalo*cough*.

[Updated on: Tue, 01 May 2007 10:15]

Report message to a moderator

Re: A math question. [message #256684 is a reply to message #255878] Tue, 01 May 2007 15:42 Go to previous messageGo to next message
Zion is currently offline  Zion
Messages: 2722
Registered: April 2006
Karma: 1
General (2 Stars)
Not completely sure but the logistic side of this may help you.

Automatic Ballistic Artillery Cannon using The Wire Addon for GMod10

Maybe the large diagram further down with math operations and constants can help you with the logic of programming this. Be warned though, most of the 'gates' and 'arithmatic chips' are programmed into channels of inputs and outputs, but they should be labeled on the diagram anyway.
Re: A math question. [message #256785 is a reply to message #255878] Wed, 02 May 2007 09:10 Go to previous messageGo to next message
StealthEye is currently offline  StealthEye
Messages: 2518
Registered: May 2006
Location: The Netherlands
Karma: 0
General (2 Stars)

mathomatic ftw!
http://mathomatic.orgserve.de/math/

1-> L = (X+S/2)*W/S-((O*W)/100)

             S
        (X + -)*W
             2      O*W
#1: L = --------- - ---
            S       100

1-> simp

           1    O    X
#1: L = W*(- - --- + -)
           2   100   S

1-> X

         L   1    O
#1: X = (- - - + ---)*S
         W   2   100
Even without it is wasn't too hard though. Razz


BlackIntel admin/founder/coder
Please visit http://www.blackintel.org/

[Updated on: Wed, 02 May 2007 09:12]

Report message to a moderator

Re: A math question. [message #256791 is a reply to message #256785] Wed, 02 May 2007 10:42 Go to previous messageGo to next message
Jerad2142 is currently offline  Jerad2142
Messages: 3809
Registered: July 2006
Location: USA
Karma: 6
General (3 Stars)
I am more or less just looking for a flat out formula to do this (yes I know it is going to be multiple formula's combined). I have searched the Internet before, but no luck, I just think it would be awesome for Renegade to have a good arching projectile AI.

Re: A math question. [message #256792 is a reply to message #256791] Wed, 02 May 2007 10:46 Go to previous messageGo to next message
Crusader
Messages: 319
Registered: February 2007
Karma: 0
Recruit
Kinda like the Grenadier? An AI Grenadier who never misses would be nice!
Re: A math question. [message #256821 is a reply to message #255878] Wed, 02 May 2007 13:32 Go to previous messageGo to next message
jnz is currently offline  jnz
Messages: 3396
Registered: July 2006
Location: 30th century
Karma: 0
General (3 Stars)
Mabe a homing missile that is shot straight up into the air?
Re: A math question. [message #256827 is a reply to message #256631] Wed, 02 May 2007 14:04 Go to previous messageGo to next message
Doitle is currently offline  Doitle
Messages: 1723
Registered: February 2003
Location: Chicago, IL
Karma: 0
General (1 Star)
Moderator/Captain

Jerad Gray wrote on Tue, 01 May 2007 12:15

Can anyone give me a formula for how I would calculate what angle an artillery would have to aim at if I knew: gravity, speed of the projectile, distance away the object is from the artillery, height of the object compared to the artillery, and 0 air resistance. This is also for a program, or game more likely *cough*new AI for Renhalo*cough*.


Here you go.

R = d + v*cos(theta)*(v*sin(theta)+SqRt(v^2*.5*(1-cos(2theta))-(2*A*(0-h)))/A)

I'm pretty sure that's the Master Projectile Equation I derived back in Highscool. I still had the prgoram I made for the TI that ran the equation. Basically here's the breakdown. V = your muzzle velocity. Theta is the angle off the horizontal. A is your accelleration constant (e.g. g=9.81m/s^2) H is your initial height. D is your initial X displacement. (How far back from the edge of the cliff you are.

Hope that helps. If you can't make sense of it I'll go put it into math type to make it look a bit prettier.


http://www.n00bstories.com/image.fetch.php?id=1285726594
Re: A math question. [message #256832 is a reply to message #255878] Wed, 02 May 2007 14:26 Go to previous messageGo to next message
BlueThen is currently offline  BlueThen
Messages: 2402
Registered: February 2006
Karma: 0
General (2 Stars)
7?
Re: A math question. [message #256931 is a reply to message #255878] Thu, 03 May 2007 03:19 Go to previous messageGo to next message
Doitle is currently offline  Doitle
Messages: 1723
Registered: February 2003
Location: Chicago, IL
Karma: 0
General (1 Star)
Moderator/Captain

index.php?t=getfile&id=3285&private=0

There it is all spiffy. I included an example calculation.
  • Attachment: projshot.jpg
    (Size: 36.32KB, Downloaded 270 times)


http://www.n00bstories.com/image.fetch.php?id=1285726594
Re: A math question. [message #256963 is a reply to message #255878] Thu, 03 May 2007 07:37 Go to previous messageGo to previous message
CarrierII is currently offline  CarrierII
Messages: 3804
Registered: February 2006
Location: England
Karma: 0
General (3 Stars)

From what I remember, an SSE2 equipped CPU will run that calculation better (lots of extra maths instructions in there)

Edit - I can't spell!


Renguard is a wonderful initiative
Toggle Spoiler

[Updated on: Thu, 03 May 2007 07:37]

Report message to a moderator

Previous Topic: Ohh. Emm. Gee.
Next Topic: Anti Web blocker site?
Goto Forum:
  


Current Time: Mon Nov 18 00:01:06 MST 2024

Total time taken to generate the page: 0.01489 seconds