Topic awaiting preservation: help me think like a computer does (Page 1 of 1) |
|
---|---|
Maniac (V) Inmate From: Boston, MA, USA |
posted 08-15-2003 03:45
I didn't know where else to post this, so figured this was the closest forum... code: degreesToRadians = function(angle) {
code: degreesToRadians = function(angle){
code: degreesToRadians = function(angle) {
code: Math.degreesToRadiansPenner = function (angle){
|
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
posted 08-15-2003 05:25
Um maybe I'm missing something but why wouldn't it work? I don't remember the words for it but |
Maniac (V) Inmate From: Boston, MA, USA |
posted 08-15-2003 06:12
okay. Clearly I'm being dense. Wouldn't (degrees * PI) / 180 mean you multiply inside the parens before dividing by 180? So how can that equal the same thing as, say, dividing PI by 180 and THEN multiplying by degrees? |
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
posted 08-15-2003 08:11
Multiplication is commutative. In other words, order doesn't matter. |
Maniac (V) Inmate From: Boston, MA, USA |
posted 08-15-2003 14:06
"Does that make sense?" |
Paranoid (IV) Inmate From: Madison, Indiana, USA |
posted 08-15-2003 16:48
Steve: quote:
|
Maniac (V) Inmate From: under the bed |
posted 08-15-2003 18:45
Perhaps if you take the same formula with simpler numbers it will make more sense - |
Maniac (V) Inmate From: Boston, MA, USA |
posted 08-15-2003 20:11
Thanks for all the input. It's gradually making sense (multiplying by reciprocal helped, as did swapping in smaller simpler numbers). |
Maniac (V) Inmate From: under the bed |
posted 08-15-2003 20:27
I don't actually know, but I would guess just force of habit. |
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
posted 08-15-2003 21:54
When most people learn the conversion in school, it's said "multiply by the following constant: PI/180". So, they were probably thinking like that, and used angle * (PI/180) because it holds the constant expression together. |
Nervous Wreck (II) Inmate From: |
posted 08-15-2003 22:36
It's all about how you think about the problem: |
Maniac (V) Inmate From: Boston, MA, USA |
posted 08-16-2003 02:17
Thanks one and all. I've truly learned something I should have known all along. |