NoahGav
NoahGav

Reputation: 271

Tan function is not working c++?

I want to return the tan of a value, that value is 35 but i am getting 0.473815. But the value should be 0.70020753...? Why is it giving me 0.473815? I am using tan(35)? I can't figure out why it is saying that.

Upvotes: 0

Views: 596

Answers (1)

Cory Kramer
Cory Kramer

Reputation: 117951

The trig functions in C++ (std::sin, std::cos, std::tan, etc) take arguments of radians not degrees

From cppreference

Parameters
arg - value representing angle in radians, of a floating-point or Integral type

Upvotes: 5

Related Questions