# Math.Cos2 from Math.cos?

This topic is 2590 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I have a little problem here... The language I am using does not have Math.cos2() function, it only has a Math.cos() function. How do I solve this?

I was looking at the wikipedia article on cosigns and am stumped...
http://en.wikipedia.org/wiki/Law_of_cosines

If it's not included in the language it must be something simple like Math.pow(Math.cos(x),2)? (Cos the the power of two.) Dunno...

##### Share on other sites
I've never heard of cos2. What is it?

##### Share on other sites
If you mean the thing which appears in then that is indeed just cos(x)^2, which you can get using Math.Pow like you say.

##### Share on other sites
It's just a little bit confusing way (but fully fine, standard and common) how to write a square of cosinus.
In fact this:
cos[sup]2[/sup]a
simply means:
(cos(a))[sup]2[/sup]

Which really is Math.pow(Math.cos(x),2)

##### Share on other sites
Awesome, thanks Tom.

##### Share on other sites
Just to add. One of the reasons we write it like that is so that it's clear we are taking the square of the result of the cos, and not squaring the angle within the cos. Plus I get to be lazy and not write parenthesis.

1. 1
2. 2
Rutin
20
3. 3
khawk
18
4. 4
A4L
14
5. 5

• 12
• 16
• 26
• 10
• 44
• ### Forum Statistics

• Total Topics
633761
• Total Posts
3013725
×