The above video goes away if you are a member and logged in, so log in now!

 Would you like to get all the newest Gaming News fromQJ.NET in your email each day? Want to learn more about the team who brings you the QJ news?

This is a discussion on Math Help Thread within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; Everyone knows that math and computer programming go hand in hand, However not all of us are gifted in math ...

 Tweet

Everyone knows that math and computer programming go hand in hand, However not all of us are gifted in math so this is the thread to come to when u need help with trying to get equations and formulas for certain functions

2. what is the answer to this 2/7^2/3*13

3. ignore

4. Originally Posted by gamer4lif3
what is the answer to this 2/7^2/3*13
r u serious??

Im havin a problem here:
considering the equation sin(t*PI);
my t which is time goes up by .05 every time but i want to do something everytime it hits a whole number
can some1 help me out with this??

5. if abs(sin(t*PI))==1 then do something

Where abs gets the absolute value of a number. Sin only returns a number from -1 to 1. Not sure if you want 0 to be a whole number.

6. Originally Posted by chingwyn
r u serious??

Im havin a problem here:
considering the equation sin(t*PI);
my t which is time goes up by .05 every time but i want to do something everytime it hits a whole number
can some1 help me out with this??
when sin(t*PI) hits a whole number? or when t hits a whole number? because then the sin equation becomes irrelevant, and you could just have a check for when the greatest integer function of t = t, otherwise, since your period of the sin equation is 2, the sin function would hit a whole # at t = 0, 0.5, 1, 1.5, and 2 (zeros are whole). again, it's all about the greatest integer function that'll make it much easier for you. this is of course assumign that you're using math.h in c language, not lua. i'm not even sure what math fcts lua incorporates but oh well

*edit*
Originally Posted by matriculated
if abs(sin(t*PI))==1 then do something

Where abs gets the absolute value of a number. Sin only returns a number from -1 to 1. Not sure if you want 0 to be a whole number.
much more elegantly put, if zeros are not an issue.

7. Originally Posted by gamer4lif3
what is the answer to this 2/7^2/3*13
be way more specific

to me it looks like 2/7 to the power of 2/3 x 13, so be more specific and ill program a quick one for ya nd have it display the answer, jsut for pracitive

8. 2/(7^2)/3*13 because its an exponent

(((2/49)/3)*13)

0.17687074829931972789115 646258503

9. Originally Posted by matriculated
if abs(sin(t*PI))==1 then do something

Where abs gets the absolute value of a number. Sin only returns a number from -1 to 1. Not sure if you want 0 to be a whole number.
im dont want the y values but x

Originally Posted by freakystyley
when sin(t*PI) hits a whole number? or when t hits a whole number? because then the sin equation becomes irrelevant, and you could just have a check for when the greatest integer function of t = t, otherwise, since your period of the sin equation is 2, the sin function would hit a whole # at t = 0, 0.5, 1, 1.5, and 2 (zeros are whole). again, it's all about the greatest integer function that'll make it much easier for you. this is of course assumign that you're using math.h in c language, not lua. i'm not even sure what math fcts lua incorporates but oh well

*edit*

much more elegantly put, if zeros are not an issue.
im strictly c/c++ and java

wat i put before was:
if( t== perC){
printf("in method");
perC++;
}
initialy perC is 1
but this doesnt work

10. anyone know how to create a key generator? like in the other thread, that guy gave an example of

CHEESE
+ HAM
---------
TURKEY
? how could u possibly do that because its adding, but you cant literally 'add' 2 numbers together like 6 + 10 = 610, itd return 16, so how would u do that?

11. Originally Posted by SG57
anyone know how to create a key generator? like in the other thread, that guy gave an example of

CHEESE
+ HAM
---------
TURKEY
? how could u possibly do that because its adding, but you cant literally 'add' 2 numbers together like 6 + 10 = 610, itd return 16, so how would u do that?
Example number: 134 = 4*1 + 3*10 + 1*100

PLACE VALUES!

Its the core to all math, of all bases, such as hex and binary.

12. The reason your t value that increase by .05 each time is rounded up is because you probably made t an integer, you need to make it a float or a double.

13. Originally Posted by Ravine
The reason your t value that increase by .05 each time is rounded up is because you probably made t an integer, you need to make it a float or a double.
i instantiated it as a double lookin through all my code to c if i reset it or somethin

14. need some help again i wanna make a projectile tha changes according to the angle
i was thinkin of using a few physics formulas but just wondering if any1 has a simpler way of doing

15. Kind of like a rotating code snippet? If you used that, ave if it rotates 10*, return something you can make a bool out of that could mess with the launch angle/mess with the y launching speed/x launching speed.

16. Originally Posted by chingwyn
i instantiated it as a double lookin through all my code to c if i reset it or somethin
For most maths applications you're better off not letting the computer do all the thinking, especially if you're approximating functions using discrete arithmetic.

In the case of a sin function, it's pretty common knowledge that the output is a sine wave, varying from -1 to +1. Therefore, as previously mentioned, you only need to worry about whole values of y at -1, 0, +1.

Since the -1 and +1 are minimum and maximum, then you can detect the points at which the output value crosses the values of interest pretty easily:

-1 is found when the output value stops decreasing, and starts increasing.

+1 is found when the output values stops increasing, and starts decreasing.

0 is found when the sign of the output changes, i.e. from positive to negative or vice-versa.

In each of these cases, if y is not exactly the value you were looking for, then the value of x that you're looking for must lie somewhere between the previous value of y and the current (when one of the conditions above is detected).

In general, though, it's often easiest just to apply some basic maths to solve the function on paper, rather than apply a computational method.

Sine is a well understood function, so it's easy enough to determine by analysis for which inputs its output will be -1, 0 or 1, and then solve the equation to find the values of t that are of interest.

17. thanx

18. (3.8*10^12)(5.8*10^12)

19. Wow, Fanjita... Talk about a hang over... You just left me with a migrain.

20. yea thats like math a+b and calculas combined

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•

All times are GMT -8. The time now is 08:46 AM.

Use of this Web site constitutes acceptance of the TERMS & CONDITIONS and PRIVACY POLICY