From db072ad4dc181eca5a1458656b130beb43f475bf Mon Sep 17 00:00:00 2001 From: 53hornet <53hornet@gmail.com> Date: Sat, 2 Feb 2019 23:33:15 -0500 Subject: Init. --- hw4/bin/HW1.cpp | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 hw4/bin/HW1.cpp (limited to 'hw4/bin/HW1.cpp') diff --git a/hw4/bin/HW1.cpp b/hw4/bin/HW1.cpp new file mode 100644 index 0000000..8e66297 --- /dev/null +++ b/hw4/bin/HW1.cpp @@ -0,0 +1,38 @@ +#include +#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; +} -- cgit v1.2.3