Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Math Thread. (https://forums.graalonline.com/forums/showthread.php?t=23191)

Saga2001 02-07-2002 12:01 AM

Math Thread.
 
I know a lot of things in graal are math orented, and I can do the math, but I don't really know the terms. So what I say is we have a thread where everyone who knows what the terms in math mean they tell eachother, because I have some problems with telling people about what I need. Like for example maybe we could make a like terms list, because it seems that people like Kaimetsu know their stuff very well, and could help me and probably many fellow scripters. Also we could post here about how to do other advanced mathematics, and whatever we wanted. I would really like to be more knowledgable in math, and I believe that the people here could help. Thanks and I hope this turns out well.

TDO2000 02-07-2002 02:40 AM

how to emulate Z-Axis movement?

I do not realy understand the way u have to move objects it seems they are moving in 3 dimensions...
(formular and explanation not a whole script ;) )

TDK_RC6 02-07-2002 04:26 AM

(A x A) + (B x B) = (C x C)

Wes2000 02-07-2002 05:06 AM

What parameters would A,B, and C controll?

Saga2001 02-07-2002 06:06 AM

Heh, no clue. Z-Axis? is that like the way that kaimetsu had that 3d engine?

Faheria_LAT1 02-07-2002 07:09 AM

I dont know but there's an undocumented command called [i dont know if i can reveal it =P] but i dont know what it does or what it's for x_X

TDK_RC6 02-07-2002 10:11 AM

a squared plus b squared equals c squared

Faheria_GP2 02-07-2002 10:30 AM

Quote:

Originally posted by TDK_RC6
a squared plus b squared equals c squared
in a right triangle, where C is the length of the hypotenuse

dragoonvenganc 02-07-2002 10:33 AM

LOL

(a*a)+(b*b)=(c*c)
a^2+b^2=c^2
might i say this is the pathagoem theorm.. mispelled though..
all scripters should know what this is if not go back to school u stupid people..
u learn in geometry and algebra 2 and above.. i dont think u learn in algebra 1 but u might.

a= one side
b=second side
c=the hypotenuse..
the formual for a trigange..
the hypotenuse is the side oposite the right angle

Saga ... Past Austin.. u can just ask me.. lol... I'm in precalculs.. lol.. Come on.. this stuff is really easy..

And Have u finished the system... Yet... i have not seen u... if u dont get it done.. soon.. come on... i need to know...

nyghtGT 02-07-2002 10:42 AM

Quote:

Originally posted by TDK_RC6
(A x A) + (B x B) = (C x C)
You stole my theorem sucka !

nyghtGT 02-07-2002 10:46 AM

also,

If two lines are perpendicular to a coplanor line, then the lines are parallel to each other ...

dragoonvenganc 02-07-2002 10:48 AM

actually.. i put it there for the stupid people
because every time i have seen it i see it as
a^2+b^2=c^2

i was adding what u had for all the little people out there.. that are in 7th or 8th grade and trying to script
and possibly. .9th but some of them know what there doing

dragoonvenganc 02-07-2002 10:50 AM

ya your point being.. with that

nyghtGT 02-07-2002 12:03 PM

Quote:

Originally posted by dragoonvenganc
actually.. i put it there for the stupid people
because every time i have seen it i see it as
a^2+b^2=c^2

i was adding what u had for all the little people out there.. that are in 7th or 8th grade and trying to script
and possibly. .9th but some of them know what there doing

triangles are hardly used in graal ...

Saga2001 02-07-2002 03:11 PM

Quote:

Originally posted by dragoonvenganc
actually.. i put it there for the stupid people
because every time i have seen it i see it as
a^2+b^2=c^2

i was adding what u had for all the little people out there.. that are in 7th or 8th grade and trying to script
and possibly. .9th but some of them know what there doing

i know the theroum, but i do not know where or when to put it to use.

nyghtGT 02-07-2002 03:54 PM

Quote:

Originally posted by Kaimetsu


Well now that's just wrong.

3D stuff: Create a plane just in front of the player and find intersections between it and the line from the player to the object. Find the position of the intersection point relative to the player's LOS and bingo.

*i hardly use traingles in graal

TDO2000 02-07-2002 09:30 PM

Phytagoras is used for Z-Axis movement... hmmm this sounds logical... *slaps his head* omg I hadn't thought it should be that easy k thx people ^_^

Falcor 02-07-2002 10:19 PM

I have 1 question, How do Arcus Tangens (arctan) Work?
What does it do with the input you give it?
BTW, a LOG() scripting command would be nice... eg, finding how many place values something has. (could find how many decimal valuse too by doing int(log(var%1)) )

Logarithms are handy gagets :p

Saga2001 02-08-2002 12:38 AM

Quote:

Originally posted by Kaimetsu


Ah, I see you assume that we'd be talking base 10 logarithms. Bear in mind, grasshopper, that this is not the only way of using logs.

lol grasshopper.


can someone give me an accurate description of what:
1.) Logarithms are.
2.) Vector...???
3.) Where would you use pythagoreus?
4.) How can u use things like arctan to do anything useful?

I am hoping my new reading experiance Elementary Modern Physics (Second Edition) by Richard T. Weidner / Robert L. Sells will help me, but if anyone has any other suggestions on criteria i should read to get more close to such math please butt in.

mikepg 02-08-2002 07:48 AM

Explanation of Things
 
Logs are just exponential equations written differently.

LOG x = x^b i believe.
b

Math teachers use it just to confuse you ;)

Im not sure if arctan is co-tangent or just tangent.

Tangent is sin(t)/cos(t)
Cotangent is cos(t)/sin(t)

Sin is a term used in trigenometry which is equal to to point y on a circle, divided by the radius of the circle

so a circle with the radious 1, and the point on 0,1
would be sin(1).....which is equal to a number of radians (a circle divided evenly). the number of radians is for this (sin(1)) 1pi/2
where pi is that symbol that looks like half the capital letter H. (roughly 3.14).

cos (which is cosine) is the same, except with the x value of the point.

In order to find some points on a circle, pythagorean therom needs to be used.

say you dont know the radious. The point is on 2,1. Supposing that the circle's center is positioned on the origin, this is where pt would come in. So, side a would be 2, because thats how many units you go over on the graph. Side b is 1, since that is how many units you go up. Now you have 2 legs of a triangle. The third leg, is from the point on the circle, to the origin. side c. Side c*c= a*a + b*b
c*c= 2*2 +1*1
c*c=4+1
c*c=5
c=sqrt(5)
so, the radious of the circle is the square root of 5 (which cannot evenly be factored out).


Im not a teacher of mathematics, so some things may be off or just wrong. I'm only in the 10th grade, and in the second semester of Math Anaysis (sp). So, if someone else can explain it better, go ahead ;). I hope i helped you.

A math education of Geometry or higher is recommended for scripters.

Falcor 02-08-2002 08:03 AM

ah, the invers of tan? Great thanks, I was stumped :p

LiquidIce00 02-08-2002 08:08 AM

Pythegoreum theorum (i can never spell that crap)
can be used really well for making stuff around the player. If you want to find a certain area around the player. Like a square, you just do it twice, or if you dont want to make a circle area around the player but a triangular one ..and etc.. whatever ur mind puts to it.. and yeah triangles are not used much . Circles are best ;)

dragoonvenganc 02-08-2002 10:24 AM

arctanget is used for finding a angel of a right trangel
arctangent is notated as tan^-1 tangent to -1 power..
same for arccos, arccot and so on

Now sec is the opposite of sin which means if sine = 1/2 sec = 2/1

sin = y/hypotenuse
cos = x/hypotenuse
sec = hypotenuse/x
csc = hypotenuse/y
tan=sin/cos=y/x
cot=cos/sin=x/y

I am pretty sure

i use pythageorm theom for.. finding the distance.. between 2 objects
but its easyer to just use the distance formula
which is
squareroot((x1-x2)^2+(y1-y2)^2)

Saga2001 02-08-2002 11:56 AM

Wow thanks a lot, I can do the math, but only if I know how the math is expressed. I too am in the 10th grade, I take IMP (Interactive Mathematics Program) and it is the crappiest education you'll ever get - heck though, easy A. Outside of school I take college classes and try to learn as much as I can since my teacher is as dumb as a goat. You have learned me well though ;) and dragon, I am still on ofter im me I will show you how far i am on the system.

BocoC 02-08-2002 11:59 AM

Quote:

Originally posted by TDK_RC6
(A x A) + (B x B) = (C x C)
Actually,

C^2=A^2+B^2-2AC*COS(C) (I think.)
C^2=A^2+B^2 is only for Right Triangles.

nyghtGT 02-08-2002 01:54 PM

The hypotenuse is the side oposite the right angle, correct ?

Saga2001 02-08-2002 11:32 PM

Re: Re: Explanation of Things
 
Quote:

Originally posted by Kaimetsu


Wrongo. Something similar to that, but not quite.

Also your definitions of sin and cos are overly convoluted. You'd have been better to just post the Taylor expansion ;)

And dragoonvec, do you realise that the so-called "distance formula" IS pythagoras?

And triangles are used far more than circles, even if you don't realise you're using them.

hahaha taylor expansion...lol...well he helped me so :p. I didn't really ever think to use pothagraes to get points on a circle and get the radius. Isn't it amazing how well math works? >.<

lordhelmut 02-09-2002 05:56 AM

I spent my entire school day studying my algebra 2 book about the sines and cosines and asking people in pre cal and trig to help me learn. I learned a little but dont understand it fully

BocoC 02-09-2002 07:01 AM

Quote:

Originally posted by lordhelmut
I spent my entire school day studying my algebra 2 book about the sines and cosines and asking people in pre cal and trig to help me learn. I learned a little but dont understand it fully
I'm in Pre Calculus... Just starting Chapter 6, Trigonometry. Fun.

Lomgren 02-09-2002 10:26 AM

my school has Trig and Pre-Calc separated into two diff semesters, I just finished Trig.
But anyway, when you think about it, sin-cos circles are just alot of right triangles!

cause
sin(a) = sideA/hypotenuse
and
cos(a) = sideB/hypotenuse
...
tan(a) = sideA/sideB
and so on....

dragoonvenganc 02-09-2002 12:15 PM

Kammy i know.. u dont have to be a jerk about it..
I know thats pyathgoem theom.. but its refeared to as distance formula because it gives u the value of the hypotenuse which is distance from point a to point b..

and of course a circle can be considered many trigangles u can just rotate the triangle.. if u have taken trig u would easly know

Yes i in 11th taking trig and precal both.

mikepg 02-09-2002 09:36 PM

sorry
 
I mixed up the logs :(

the CORRECT way is
NPC Code:

LOG c = x
b


when b=10, x=2, c=100. b is the starting number, x is the power of that number to find 100

so:
NPC Code:

LOG 100 = 2
10


LOG has a base (b) of 10 normally.

The LOG conversion is as follows
NPC Code:

LOG c / LOG q
b b


Where 'q' is the base that you want (normally in place of 10)

when b=10, c=49, and q=7:
NPC Code:

LOG (49) / LOG (7)
10 10


That will give you the value of
NPC Code:

LOG (49) which equals 2.
7


Ok, I'm done with logs.

If its wrong, correct me I guess, as for the tailor expansion, hahaha, funny ;).

(Sorry about the edits, I wanted the equations to look correct.)

Androk2k1 02-09-2002 09:47 PM

Me.. so... confused... what kind of grade is it? I am in 9... I understand some of the stuff you say but not all...

here is a funny logic task that I stupidly answerd wrong...

Bobby has 9 marbles, 2 red, 3 green, 4 blue, he put all of tem in apocket and takes one at a time without looking, how many marbles does he have to pull out to be sure that he has 3 of one color?

Lomgren 02-10-2002 11:52 AM

Quote:

Originally posted by Androk2k1
Me.. so... confused... what kind of grade is it? I am in 9... I understand some of the stuff you say but not all...

here is a funny logic task that I stupidly answerd wrong...

Bobby has 9 marbles, 2 red, 3 green, 4 blue, he put all of tem in apocket and takes one at a time without looking, how many marbles does he have to pull out to be sure that he has 3 of one color?

I'd put my money on nine, heh

Wes2000 02-10-2002 12:35 PM

7
this is why:

he can pull-
red
red
green
green
blue
blue

which leaves-
1 green
2 blue

so the next one has to make 3 of either green or blue so thats 7 pulled.

Saga2001 02-11-2002 11:26 AM

i'm with nine...

Torankusu 02-12-2002 04:58 AM

Quote:

Originally posted by dragoonvenganc
LOL

(a*a)+(b*b)=(c*c)
a^2+b^2=c^2
might i say this is the pathagoem theorm.. mispelled though..
all scripters should know what this is if not go back to school u stupid people..
u learn in geometry and algebra 2 and above.. i dont think u learn in algebra 1 but u might.

a= one side
b=second side
c=the hypotenuse..
the formual for a trigange..
the hypotenuse is the side oposite the right angle

Saga ... Past Austin.. u can just ask me.. lol... I'm in precalculs.. lol.. Come on.. this stuff is really easy..

And Have u finished the system... Yet... i have not seen u... if u dont get it done.. soon.. come on... i need to know...

I took the pre-algebra courses in sixth, so I'm just here to say it's not only for Algebra2+. But, that could only be for my school/state.

neomaximus2k 02-12-2002 02:45 PM

Bah i aint done maths in 3 years, this is A-Level stuff from what i have seen tho

Slaktmaster 02-12-2002 03:30 PM

It's seven.

Saga2001 02-12-2002 11:33 PM

i was joking so. :p. I did probibilities like 3 years ago. However, I have another question, if you were making a circular weapon select system, where it displays your weapons in a circle, like the hat trading thing BocoC made what would you do?


All times are GMT +2. The time now is 08:22 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.