Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/VDM/VDMPP/QuadilateralPP/   (Vienna Development Method ©)  Datei vom 13.4.2020 mit Größe 989 B image not shown  

Quelle  vector.vdmpp

  Sprache: VDM
 

class Vector 
 
  values
    public NullVector : vector = mk_vector (mk_(0,0),mk_(0,0))
 
  types
    public
    vector :: head: Position
              tail: Position;
 
    public
    Position = Coordinate * Coordinate;
 
    public
    Coordinate = nat
 
  functions
    public
    inproduct: vector * vector -> real
    inproduct (v1, v2) ==
      let mk_vector (mk_(hd1x, hd1y), mk_(tl1x, tl1y)) = v1,
          mk_vector (mk_(hd2x, hd2y), mk_(tl2x, tl2y)) = v2 in
        (tl1x - hd1x) * (tl2x - hd2x) + (tl1y - hd1y) * (tl2y - hd2y);
 
    public
    length: vector -> real
    length (v) ==
      let mk_vector (mk_(hdx, hdy), mk_(tlx, tly)) = v in
        MATH`sqrt ((tlx - hdx)**2 + (tly - hdy)**2);              
 
    public
    add: vector * vector -> vector
    add (v1, v2) ==
      let mk_vector (hd1, mk_(tl1x, tl1y)) = v1,
          mk_vector (mk_(hd2x, hd2y), mk_(tl2x, tl2y)) = v2 in
        mk_vector(hd1, mk_(tl1x + (tl2x - hd2x), tl1y + (tl2y - hd2y)))
 
end Vector


Messung V0.5 in Prozent
C=100 H=100 G=100

¤ Dauer der Verarbeitung: 0.11 Sekunden  (vorverarbeitet am  2026-06-05) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

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 und die Messung sind noch experimentell.