Skip to content

PolymorphicAgent/Vector-Tangent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vector Tangent: A Challenge Problem

Write an algorithm that calculates the tangent of any arbitrary angle (in degrees) with the following restrictions:

  • The use of trigonometric functions is prohibited unless comparing the calculated value to the actual value returned by std::tan.
  • The use of the built-in square root function is prohibited.

Your solution must use vectors.


This was the prompt presented to me by a friend, my response to which is the program displayed above.

Building

This program can be built with g++.

g++ -o Vector-Tangent main.cpp Vector.cpp

If you prefer to quickly view/tinker with this small project on the web, it may be found at the following link:

https://www.onlinegdb.com/Lm8XCq5Qp

Note: inputting unreasonably large numbers may cause undesired outputs due to the use of floating-point numbers.

About

Computes tangent without trig or sqrt!

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages