#include <math.h> #include "gvector.h" GVector::GVector( double tx, double ty ) { x = tx; y = ty; } GVector::~GVector(void) { } GVector GVector::operator+( GVector v ) const { return GVector( x + v.x, y + v.y ); } GVector GVector::operator-( GVector v ) const { return GVector( x - v.x, y - v.y ); } GVector GVector::operator/( double d ) const { return GVector( x / d, y / d ); } GVector GVector::operator*( double d ) const { return GVector( x * d, y * d ); } double GVector::operator*( GVector v ) const { return x * v.x + y * v.y; } double GVector::operator~() const { return sqrt( x * x + y * y ); }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 4763 | Sam Stafford |
Rename //guest/sam_stafford/jamgraph/... to //guest/sam_stafford/jamgraph/main/... to support mainline model in sample depot. |
||
//guest/sam_stafford/jamgraph/gvector.cpp | |||||
#1 | 3023 | Sam Stafford |
A toy. Soon to be (hopefully) a toy powered by Jam. |