Discuss Scratch

JinckUFO
Scratcher
79 posts

Radian Mode for Trigonometric Functions.

I've been working on a project that involves trigonometric functions, and realized that I need to be able to use radian angle measurement for it to work, and that scratch only works with degree measurement. I did eventually find a workaround for it, but it was a long process, and I think it would generally be a good thing if a radian mode was added somewhere in the operators category. Just my thought.

Edit: The workaround is a series of if/then statements, and is not very accurate. It only works on the project that I'm making because it's not very sensitive. The workaround the person posted below is technically the conversion formula, but it doesn't change the fact that the function does not work for radians. If I believed that the workaround was just something that anyone could do for anything, then I wouldn't be here. So don't say, “Just use the workaround”.

Last edited by JinckUFO (July 18, 2016 22:30:19)

Sigton
Scratcher
1000+ posts

Radian Mode for Trigonometric Functions.

Can you post the workaround?

Sigton
alexphan
Scratcher
1000+ posts

Radian Mode for Trigonometric Functions.

Sigton wrote:

Can you post the workaround?

Sigton
definedegdegreestoradianssetresulttodeg*3.1415926.../180
definedegradianstodegreessetresulttodeg*180/3.1415926...

Last edited by alexphan (July 18, 2016 21:51:44)

Sigton
Scratcher
1000+ posts

Radian Mode for Trigonometric Functions.

Thanks

No support, the workaround is easy. Especially for the people with advanced enough maths skills to work with radians.

Sigton
JinckUFO
Scratcher
79 posts

Radian Mode for Trigonometric Functions.

Sigton wrote:

Can you post the workaround?

Sigton
Yeah, it's essentially what alexphan wrote, except you have to figure out when to do the conversions. It's not always the most simple. For example: 90 degrees and pi/2 should both report the same result for sine (1), but when you convert 90 into radians with the formula it does not output 1.
Sigton
Scratcher
1000+ posts

Radian Mode for Trigonometric Functions.

JinckUFO wrote:

Sigton wrote:

Can you post the workaround?

Sigton
Yeah, it's essentially what alexphan wrote, except you have to figure out when to do the conversions. It's not always the most simple. For example: 90 degrees and pi/2 should both report the same result for sine (1), but when you convert 90 into radians with the formula it does not output 1.
That's not really the fault of the lack of the block though, that's just the mathematical use of the function.

Sigton
JinckUFO
Scratcher
79 posts

Radian Mode for Trigonometric Functions.

Sigton wrote:

JinckUFO wrote:

Sigton wrote:

Can you post the workaround?

Sigton
Yeah, it's essentially what alexphan wrote, except you have to figure out when to do the conversions. It's not always the most simple. For example: 90 degrees and pi/2 should both report the same result for sine (1), but when you convert 90 into radians with the formula it does not output 1.
That's not really the fault of the lack of the block though, that's just the mathematical use of the function.

Sigton
I don't understand what that's supposed to mean: “It's just the mathematical use of the function.” What exactly does that mean? Like, “the mathematical use is that it converts things as if they were degrees”? That's not a “use” it's a problem that I'm suggesting a solution to. Or, “the function is supposed to report something different”? That would be false though.
Sigton
Scratcher
1000+ posts

Radian Mode for Trigonometric Functions.

JinckUFO wrote:

I don't understand what that's supposed to mean: “It's just the mathematical use of the function.” What exactly does that mean? Like, “the mathematical use is that it converts things as if they were degrees”? That's not a “use” it's a problem that I'm suggesting a solution to. Or, “the function is supposed to report something different”? That would be false though.
That problem could arise through misuse and/or misunderstanding of the mathematical function rather than a lacking in Scratch's abilities.

Sigton
LP_Play
Scratcher
1000+ posts

Radian Mode for Trigonometric Functions.

-1

Just use the workaround!
JinckUFO
Scratcher
79 posts

Radian Mode for Trigonometric Functions.

LP_Play wrote:

-1

Just use the workaround!
It doesn't work for all situations.

Powered by DjangoBB