Computer Science with calc based or trig based Physics? Programming Computer Science by ihatestarch … whether I take a calculus-based physics course or a trig-based physics course? I mean . . . does it matter to the… want to go to grad school? I'd rather take trig-based as I hear it's less grueling. Re: Computer Science with calc based or trig based Physics? Programming Computer Science by mrnutty No it dosen't matter. You are a computer scientist. But for your own good I would advice you to take trig based physics. In computer graphics programmer, you will use more trig and vectors than calculus. Its good if you know calculus with addition. Anyways, its your choice, why not ask one of your computer science teacher? Rotating w/ trig Programming Game Development by CoolGamer48 Hey, I'm trying to use trig to create a rotating tank (you rotate the tank by … Accuracy with trig functions Programming Software Development by MONODA Hello, I am writing an application which uses the trig functions of the math module in python but for some … Re: Accuracy with trig functions Programming Software Development by woooee ….2/lib/module-decimal.html[/url] but add on the trig functions from here [url]http://pypi.python.org/pypi/AJDecimalMathAdditions… Python, Trig, and Taylor Series Programming Software Development by thesinik … so I want to write a program that will compute trig functions (sin, cos, tan, arcsin, etc.). Basically I'm ignoring… Re: Python, Trig, and Taylor Series Programming Software Development by Ene Uran Good show! So the question is, can you use your program to compute all the trig functions you wanted (sin, cos, tan, arcsin, etc.). Fastest way to compute trig functions Programming Software Development by TheWolverine … I was wondering what the fastest way is to compute trig functions. I profiled my code and to my astonishment discovered… Re: Fastest way to compute trig functions Programming Software Development by nezachem … I was wondering what the fastest way is to compute trig functions. [/QUOTE] libm [QUOTE] I profiled my code and to… Why does this trig calculation only give results in one quadrant? Programming Software Development by Curious Gorge … finding my angle, then put that value into the right trig functions. The problem is the results of these functions only… Re: Why does this trig calculation only give results in one quadrant? Programming Software Development by Curious Gorge Nevermind, you guys are helpful but I asked this question somewhere else and they provided a *helluva* lot simpler solution for what I was working on... thank you though! I didn't even need to use the trig functions! Re: Whats wrong with my forumla? (Trig) Programming Computer Science by wildgoose Use fmod to handle angles set > < 360 degrees. If you decide to use trig functions don't forget to convert degrees to radians. PI is 180 degrees. +/- PI. Re: Computer Science with calc based or trig based Physics? Programming Computer Science by kalrajhi Calculus<3 Re: Computer Science with calc based or trig based Physics? Programming Computer Science by Rashakil Fol Why would employers care? It's not like they're going to ask you for your transcript. Re: Rotating w/ trig Programming Game Development by david.crawford does it only start acting like that once it hits 45 degree's, or is it acting like that the entire time? if its acting like that the entire time, just subtract 90 degree's from it. Re: Rotating w/ trig Programming Game Development by CoolGamer48 [QUOTE=david.crawford;518762]does it only start acting like that once it hits 45 degree's, or is it acting like that the entire time? if its acting like that the entire time, just subtract 90 degree's from it.[/QUOTE] Simply subtracting 90 doesn't work. This makes the movement when 0 is the direction weird, while it's fine when I don't subtract … Re: Rotating w/ trig Programming Game Development by CoolGamer48 Okay, the problem wasn't what I mentioned above. For some reason the expression that tank.movey equals is always the negative of what it should be. I can multiply the expression by -1 to make it work, but I don't like randomly multiplying things in my code just because I found that they work. I want to find what's causing the problem. Does anyone … Re: Rotating w/ trig Programming Game Development by MattEvans As long as its [I]always[/I] the negative of what it should be; you're ok to put in a * -1, you could also try swapping the cos and sin exprs around, so that movex is the sin, and movey is the cos. I wouldn't worry about it, the problem arises when you're using a diferent idea of what up/down left/right and 0 rads is to the maths itself.. In 2D, I … Re: Rotating w/ trig Programming Game Development by CoolGamer48 I think I found the problem. I forgot that I was working in a world where y increases as it goes [b]down[/b], not up. So the values were actually what I expected them to be, those values just didn't produce the result I wanted. Re: Accuracy with trig functions Programming Software Development by MONODA Thanks, I don't think I'll use the decimal module, instead I'll check to see if the difference between two values is between a certain threshold rather than checking to see if they are equal. Re: Accuracy with trig functions Programming Software Development by sneekula This might help: [code=python]# see also: http://www.daniweb.com/forums/post896314-177.html import math def fuzzyequals(a, b, delta=0.0000000001): """ returns true if a is between b-delta and b+delta used for comparison of floating point numbers a and b """ return abs(a-b) < delta # cosine of … Re: Accuracy with trig functions Programming Software Development by MONODA Nice, thanks a lot for your help. Re: Python, Trig, and Taylor Series Programming Software Development by vegaseat To approximate for instance the sine of x (x in radians) you can use the Taylor series expansion: x - x**3/3! + x**5/5! - x**7/7! + ... However, to get even a remotely accurate number the cutoff for the convergence is large. Your factorials will be huge very quickly too and make floating point numbers impossible. There are other series … Re: Python, Trig, and Taylor Series Programming Software Development by thesinik [QUOTE=vegaseat;1060302]To approximate for instance the sine of x (x in radians) you can use the Taylor series expansion: x - x**3/3! + x**5/5! - x**7/7! + ... However, to get even a remotely accurate number the cutoff for the convergence is large. Your factorials will be huge very quickly too and make floating point numbers impossible. … Re: Python, Trig, and Taylor Series Programming Software Development by Gribouillis [QUOTE=thesinik;1060404]I ended up figuring it out by breaking down sin into a function of series rather than using Taylor expansions. It was much simpler. This was my code for sin: [CODE] def sine(x): sum = 0.0 n = 0.0 term = 1.0 while (term > .0000000001): #loops until the iterations grow so large that 'term' … Re: Python, Trig, and Taylor Series Programming Software Development by thesinik I've already submitted my assignment and my professor's standards aren't as high as far as efficiency goes, theory matters more to him. But I do see what you did there, thanks for the help everyone! :D Re: Fastest way to compute trig functions Programming Software Development by mrnutty If you need optimization that badly, then make a look up table with cosine and sinus table. Re: Why does this trig calculation only give results in one quadrant? Programming Software Development by ddanbe I don't know what unity3d is, but if you have difficulties converting between radians and degrees, this C# might help: public const double cToDegrees = 180.0 / Math.PI; public const double cToRadians = Math.PI / 180.0; static public double ToRadians(double degrees) { return degrees * … Re: Why does this trig calculation only give results in one quadrant? Programming Software Development by pritaeas > I don't know what unity3d is It's a [game engine](http://docs.unity3d.com/Manual/index.html). Help with sub Classing Programming Software Development by Sumal … -1; return ans; } /* * Trigonometric function solver. */ double trig(){ double ans = 0; boolean found = false; if( s.indexOf(…quot; ) == 0 ){ s = s.substring( 3 ); ans = Math.tan( trig() ); found = true; } if( !found ){ ans = exp(); } return …