Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/PVS/trig_fnd/   (Beweissystem der NASA Version 6.0.9©)  Datei vom 28.9.2014 mit Größe 948 B image not shown  

Quelle  jatan2.pvs   Sprache: PVS

 
%------------------------------------------------------------------------------
% Java atan2  --> (-pi, pi)
%
% Java atan2(y,x) converts rectangular coordinates (x,y) to polar (r,?),
% where r is the distance from the origin and ? is the angle from the x-axis.
% The equation for determining atan2 is: tan? = y / x (where ? is the angle).
% The output values are in the range between -pi and pi
%------------------------------------------------------------------------------
jatan2: THEORY
BEGIN
 
    IMPORTING trig_values, trig_inverses,  atan2_props
  
    x,y: VAR real

    jatan2(y:real,x:{z:real|y=0 => z/=0}): real = IF y >= 0 THEN atan2(x,y)
                                                  ELSE atan2(x,y) - 2*pi
                                                  ENDIF


%%  TEST

    t1: LEMMA jatan2(1,1) = pi/4
    t2: LEMMA jatan2(-1,1) = -pi/4
    t3: LEMMA jatan2(1,-1) = 3*pi/4
    t4: LEMMA jatan2(-1,-1) = -3*pi/4

END jatan2


100%


¤ Dauer der Verarbeitung: 0.7 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung ist noch experimentell.