Page MenuHomec4science

vect3d.h
No OneTemporary

File Metadata

Created
Thu, Dec 5, 05:28

vect3d.h

#ifndef __VECT3D_H__
#define __VECT3D_H__
#include <array>
typedef std::array<double, 3> Vector;
Vector& operator+=(Vector& v, const Vector& w);
Vector& operator-=(Vector& v, const Vector& w);
Vector& operator*=(Vector& v, double k);
Vector& operator/=(Vector& v, double k);
Vector operator+(const Vector& v, const Vector& w);
Vector operator-(const Vector& v, const Vector& w);
Vector operator*(const Vector& v, double k);
Vector operator/(const Vector& v, double k);
/* cross product */
Vector operator^(const Vector& v, const Vector& w);
/* dot product */
double operator*(const Vector& v, const Vector& w);
bool operator==(const Vector& v, const Vector& w);
bool operator!=(const Vector& v, const Vector& w);
double module(const Vector& v);
double sq_module(const Vector& v);
Vector unit(const Vector& v);
const Vector nullv = {0, 0, 0};
#endif

Event Timeline