blob: 8e662974d7da43092bdadb1d25d24a2e8b1a1bbf (
plain) (
tree)
|
|
#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;
}
|