blob: 5faa016aa9768e583efd09d7f2a9d5df00c0f2d0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<!-- $Id: vec2.html 153 2000-09-05 16:11:26Z garland $ -->
<html>
<head>
<title>libgfx: Vector Math</title>
<link rel=stylesheet href="cdoc.css" type="text/css">
<meta name="Author" content="Michael Garland">
</head>
<body>
<h2>Vector Math</h2>
<h3>class Vec2</h3>
<p> This class implements a 2-dimensional real-valued vector.
Individual elements are represent with <code>double</code> precision
floating point numbers. To use the <tt>Vec2</tt> class you must
include the header
<pre>
#include <gfx/vec2.h>
</pre>
<h4>Constructor Methods</h4>
<p>The <tt>Vec2</tt> class defines the following set of constructors:
<pre>
Vec2(); <i>// Initializes vector to (0 0).</i>
Vec2(double x, double y); <i>// Initializes vector to (x y).</i>
Vec2(double s); <i>// Initializes vector to (s s)</i>
Vec2(const Vec2& v); <i>// </i>
Vec2(const float v[2]); <i>// These copy values from v</i>
Vec2(const double v[2]); <i>// </i>
</pre>
<h4>Specialized Functions</h4>
<p>Beyond the standard functions supported by all vector classes, the
<tt>Vec2</tt> class provides the following additional function:
<pre>
Vec2 perp(const Vec2 &v);
</pre>
that returns a new vector which is perpendicular to the given vector.
</body>
</html>
|