What are the Differences between certain math functions

Hi,

so i am wondering what are differences between certain math functions
For Example:

math.sin, math.asin

math.cos, math.acos, math.cosh

math.tan, math.atan, math.atan2

What’s so different between them?


And also, How would I use them in scripting?

Anything is appreciated,

Thanks

math.sin:
( devices )

Math.sin(0);           // 0
Math.sin(1);           // 0.8414709848078965

Math.sin(Math.PI / 2); // 1

console
math.cos


function getCircleX(radians, radius) {
  return Math.cos(radians) * radius;
}

console.log(getCircleX(1, 10));
// expected output: 5.403023058681398

console.log(getCircleX(2, 10));
// expected output: -4.161468365471424

console.log(getCircleX(Math.PI, 10));
// expected output: -10

I leave you this tutorial:

1 Like

uuuh, yeah, this isnt very helpful.

Why JavaScript?

but tell me what you need to do and I’ll help you (I don’t know about that but I can help you solve problems) in the forum you have to be more exact

1 Like

ecause this method is not used in lua… good yes

I see,

Well im going to have to go to my classes, i’ll take a look later, thanks tho

Tell me what you need and I’ll help you

These are functions related to math concepts that you learn in academia, specifically these are from trigonometry that’s typically covered in depth in secondary education (high school). These are respectively sine, cosine and tangent as well as their inverse functions (e.g. asin is arcsine, the inverse of sine). atan2 is the arctangent given two values y and x.

You’re thinking backwards here. These are functions that you use to solve problems, not solutions you use to go find problems. You use them in programming when there’s a need to do so and that’s generally when you’re working with anything related to world coordinates, angles, placements or any complex system with basis in the 3D world.

If you don’t know the underlying math concepts these will be tricky to use naturally and you’re going to have to get a fair amount of help or resources to assist you when the time comes to actually deploy them. It’s a fairly big reason as to why math happens to be a prerequisite for post-secondary courses related to programming.

8 Likes

Im just asking what is the difference, and in what occassion do i use them in code, because looking at them, they have somewhat similar descriptions, unless i missed something

I get their full names (It literally says it too), I get that they are used to solve problems (Thats kind of obvious), and that they are Math Concepts plus are High School related. But once again, i am just asking what is so different between them and what are the times do i use these math functions when scripting.

How is someone supposed to tell you the difference if you don’t know what any of them means? What you’re asking for doesn’t make any sort of sense respectfully. You’ll learn what these functions do in school, usually around grade ten. If you’re truly curious, you can try to learn it on your own, maybe try googling “trigonometry”?

You won’t ever use these functions as of right now considering you don’t know their implications, although even generally they’re seldomly used.

1 Like

Im just asking what do these functions do differently than the other, thats already been mostly covered by @colbert2677

Right now I’m wondering what are the times i DO use them as i stated at the end of the topic.

You may use them when dealing with physics, CFrames (not typically), animations (indirectly, some ease functions are trigonometric), camera manipulation, visual effects. Lots of things.

1 Like

Great, thats really all i needed to know, thank you, i wish i could give 2 solutions tho

While generally used for triangles, it could be used for a triangle generation function. Triangle Minecraft, if you would.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.