Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 


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

92%


¤ Dauer der Verarbeitung: 0.1 Sekunden  (vorverarbeitet)  ¤

*© 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.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge