S
S
Sergey Pavlov2014-01-26 18:28:36
Python
Sergey Pavlov, 2014-01-26 18:28:36

How, by counting sin (pi / 3), to get the answer "√3/2", and not its exact value?

For example: how to use math, numpy or some other library, after calculating sin(pi/3), get in the answer not 0.8660254037844386, but an irrational number '√3/2'

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Yeletsky, 2014-01-26
@Pavlov_dog

I would google something like "python symbolic math"
For starters, you can look at this library: sympy.org/en/index.html

K
KvanTTT, 2014-01-26
@KvanTTT

You can use table substitution for the most common angles from 0 to pi/2. And for the rest of the range from 0 to pi * 2 it is expanded using standard formulas (the angle must first be normalized).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question