summaryrefslogtreecommitdiff
path: root/hw2/bin/HW1.cpp
diff options
context:
space:
mode:
author53hornet <53hornet@gmail.com>2019-02-02 23:33:15 -0500
committer53hornet <53hornet@gmail.com>2019-02-02 23:33:15 -0500
commitdb072ad4dc181eca5a1458656b130beb43f475bf (patch)
treea3c03c7f5497cb70503e2486662fa85cfb53415a /hw2/bin/HW1.cpp
downloadcsci427-db072ad4dc181eca5a1458656b130beb43f475bf.tar.xz
csci427-db072ad4dc181eca5a1458656b130beb43f475bf.zip
Diffstat (limited to 'hw2/bin/HW1.cpp')
-rw-r--r--hw2/bin/HW1.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/hw2/bin/HW1.cpp b/hw2/bin/HW1.cpp
new file mode 100644
index 0000000..8e66297
--- /dev/null
+++ b/hw2/bin/HW1.cpp
@@ -0,0 +1,38 @@
+#include <iostream>
+#include "vec3d.h"
+
+int main(int argc, char** argv)
+{
+ std::cout << "CSCI-427/527 Homework 1: Vectors" << std::endl;
+
+ vec3d a(1.0f, 0.0f, -1.0f);
+ vec3d b(-1.0f, 1.0f, 1.0f);
+
+ std::cout << "a = " << a << std::endl;
+ std::cout << "b = " << b << std::endl;
+
+ std::cout << "a+b = " << a+b << std::endl;
+ std::cout << "a-b = " << a-b << std::endl;
+ std::cout << "a*b = " << a*b << std::endl;
+ std::cout << "a/b = " << a/b << std::endl;
+ std::cout << "a*2 = " << a*2.0f << std::endl;
+ std::cout << "b/2 = " << b/2.0f << std::endl;
+
+ std::cout << "a.dot(b) = " << a.dot(b) << std::endl;
+ std::cout << "b.dot(a) = " << b.dot(a) << std::endl;
+ std::cout << "a.squared_length() = " << a.squared_length() << std::endl;
+ std::cout << "b.length() = " << b.length() << std::endl;
+ std::cout << "a.distance(b) = " << a.distance(b) << std::endl;
+ std::cout << "a.cross(b) = " << a.cross(b) << std::endl;
+ std::cout << "b.cross(a) = " << b.cross(a) << std::endl;
+ std::cout << "normalize(a) = " << normalize(a) << std::endl;
+ std::cout << "abs(a) = " << abs(a) << std::endl;
+ std::cout << "b.normalize() = " << b.normalize() << std::endl;
+ std::cout << "b.abs() = " << b.abs() << std::endl;
+
+ std::cout << "a = " << a << std::endl;
+ std::cout << "b = " << b << std::endl;
+
+ // Done.
+ return 0;
+}