Know a good article or link that we're missing? Submit it!

View \VECTOR.H

3d Libmatrix

Submitted By: Unknown
Rating: starstarhalf star (Rate It)


/*
    4d vector defenitions homogenous coordinates system, 3d oriented
    5-19-97, 5:10 PM
    [[Email Removed]]
*/


#ifndef _VECTOR_H_
#define _VECTOR_H_

#include "shared.h"
#include "matrix44.h"

#ifdef __cplusplus
extern "C" {
#endif

#define vectorCopy(v1,v2) repmovsd((byte *)v1, (byte *)v2, sizeof(vector)>>2);

typedef real vector[4];

void vectorSet(vector v, real x, real y, real z, real w);
void vectorPrint(vector v);
void vectorAdd(vector v1, vector v2);
void vectorSub(vector v1, vector v2);
void vectorDivide(vector v, real s);
real vectorLength(vector v);
void vectorNormalize(vector v);
void vectorMutiply(vector v, real s);
void vectorMultiplyByMatrix(vector v, matrix44 m);
real vectorDot(vector v1, vector v2);
void vectorCross(vector v1, vector v2);

#ifdef __cplusplus
}
#endif

#endif

corner
© 1996-2008. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Publisher: Lars Hagelin.
bootstrapLabs Logo A bootstrapLabs project.