Què és Tau?
La constant és numèricament igual a 2 * pi (2 vegades pi) , i amb valor aproximadament 6.28 . La relació equival a 2*C/D. On C és la circumferència i D és el diàmetre del cercle.
Aplicacions de Tau
- N'hi ha moltes expressions que realment requereixen 2 * càlcul pi , tenir tau igual a això els simplifica en gran mesura, per ex Circumferència del cercle = 2*pi*r = tau*r .
- El concepte de tau pot ser útil mesures angulars com els angles en radians, que representen com una volta completa i les funcions cos,sinus en trigonometria tenen període de tau.
- Aquests conceptes poden ser útils per ensenyament de la geometria ja que reduiria la confusió d'utilitzar pi i 2 * pi en moltes aplicacions i ajudaria a desfer-se del factor de 2.
- Sí simplifica la identitat d'Euler eliminant el factor 2.
- És útil en molts llocs on s'utilitzen 2*pi com les transformades de Fourier, la fórmula integral de Cauchy, etc.
Crítica contra Tau
matriu en java
- Des que contradiu amb els símbols de parell, esforç tallant i temps , aquest símbol ha estat moltes crítiques.
- Ja teníem una proporció de C/D igual a pi, tenir una altra relació de cercle amb factor de dos crearà confusió en l'elecció.
- Existeixen fórmules que semblen més elegants com a expressió de pi en lloc de tau, per exemple, àrea del cercle = pi*r*r = (tau*r*r)/2, introduint un factor addicional de 1/2.
Perspectives de codificació
Atès que la programació sempre ha estat intentant coincidir amb els avenços matemàtics, el símbol de tau s'ha introduït com a constant a la recent python 3.6 sota el mòdul de matemàtiques. A continuació es mostra la il·lustració.
C++
#include> #include> int> main()> {> > // C++ has no inbuilt tau but has inbuilt pi in cmath library> > // std::cout << M_PI; // this prints the value of pi> > // but no tau, so we can use the formula 2*pi to calculate it> > std::cout <<> 'The value of tau (using 2*pi) is: '> << M_PI * 2 << std::endl;> > return> 0;> }> // This code contributed by Ajax> |
>
>
Java
constructor python
/*package whatever //do not write package name here */> import> java.io.*;> import> java.util.*;> class> GFG {> > public> static> void> main(String[] args)> > {> > // java has no inbuilt tau but has inbuilt pi in math library> > // System.out.println(''+Math.PI); this print value> > // of pi> > // but no tau thus for using it we can use formula> > // for that> > System.out.println(> > 'The value of tau (using 2*pi) is : '> > + Math.PI *> 2> );> > }> }> |
>
>
Python 3
# Python code to demonstrate the working> # of tau> import> math> # Printing the value of tau using 2*pi> print> (> 'The value of tau (using 2*pi) is : '> ,end> => '')> print> (math.pi> *> 2> )> # Printing the value of tau using in-built tau function> print> (> 'The value of tau (using in-built tau) is : '> ,end> => '')> print> (math.tau);> |
matriu de retorn de java
>
>
C#
using> System;> class> GFG {> > public> static> void> Main()> > {> > // C# has no inbuilt tau but has inbuilt pi> > // in Math library> > // Console.WriteLine(Math.PI); this print> > // value of pi> > // but no tau thus for using it we can use> > // formula for that> > Console.WriteLine(> 'The value of tau '> +> > '(using 2*pi) is : {0}'> ,> > Math.PI * 2);> > }> }> // This code is contributed by surajrasr7277> |
>
comparació de cadenes de Java
>
Javascript
inserir al teclat
// JavaScript has no inbuilt tau but has inbuilt pi in Math library> // console.log(Math.PI); // this prints the value of pi> // but no tau, so we can use the formula 2*pi to calculate it> console.log(> 'The value of tau (using 2*pi) is: '> + (Math.PI * 2));> |
>
>Sortida
The value of tau (using 2*pi) is: 6.28319>
Complexitat temporal: O(1)
Espai auxiliar: O(1)
Nota: Aquest codi no funcionarà a l'IDE Geeksforgeeks ja que Python 3.6 no és compatible.
Referència: http://math.wikia.com/wiki/Tau_(constant)