pmc/include/vector.hpp
author Markus Bröker <mbroeker@largo.dyndns.tv>
Tue, 09 Jun 2009 12:43:34 +0200
changeset 99 d99503984cd5
parent 65 76514757b0d6
permissions -rw-r--r--
ltmain.sh changed It's currently a symbolic link committer: Markus Bröker <mbroeker@largo.homelinux.org>
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
65
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     1
/**
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     2
 * test/demos/pmc/include/vector.h
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     3
 * Copyright (C) 2008 Markus Broeker
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     4
 */
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     5
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     6
#ifndef VECTOR_H
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     7
#define VECTOR_H
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     8
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     9
#include <object.hpp>
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    10
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    11
namespace algebra {
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    12
    class Vector:public Object {
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    13
      public:
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    14
        enum Mode { DEG, RAD, GRAD };
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    15
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    16
        Vector (int xx = 0, int yy = 0);
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    17
        Vector (const Vector &);
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    18
        virtual ~ Vector ();
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    19
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    20
        int X ();
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    21
        int Y ();
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    22
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    23
        Vector operator+ (Vector &);
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    24
        Vector operator- (Vector &);
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    25
        double abs ();
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    26
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    27
        void vector ();
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    28
        double angle (Vector &);
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    29
        void setMode (Mode m = RAD);
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    30
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    31
      private:
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    32
        Mode mode;
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    33
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    34
        int x;
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    35
        int y;
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    36
    };
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    37
}
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    38
#endif