B
B
BotTimofey2020-05-14 12:32:30
PHP
BotTimofey, 2020-05-14 12:32:30

How to calculate sine, cosine, tangent in degrees (FormulaParser)?

Hello, I have a problem, I'm making a calculator in php - for this I use FormulaParser ( this is a link to it in GitHub ). So, there are functions, including sine, cosine and tangent, and the problem is that I need them to be considered in degrees, and they are considered in radians. I thought, okay, this is not a problem, I'll just do the translation, but break the whole script, I did not find the place where these functions are considered. Please help, tell me where they are considered, I'm just a novice programmer.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
azat43, 2020-05-14
@azat43

function Grad2Rad($grad)
{
return $grad/180.0*pi();
}
function Rad2Grad($rad)
{
return $rad/pi()*180.0;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question