Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of Smoothie by
Vector3.h
00001 #ifndef _VECTOR3_H 00002 #define _VECTOR3_H 00003 00004 class Vector3 00005 { 00006 public: 00007 Vector3(); 00008 Vector3(float, float, float); 00009 00010 float& operator[](int); 00011 00012 Vector3 cross(const Vector3); 00013 00014 float dot(const Vector3); 00015 00016 float magsq(); 00017 float mag(); 00018 00019 Vector3 add(const Vector3); 00020 Vector3 sub(const Vector3); 00021 00022 Vector3 mul(float); 00023 00024 Vector3 unit(void); 00025 00026 private: 00027 float elem[3]; 00028 static float nan; 00029 }; 00030 00031 // typedef float Vector3[3]; 00032 00033 // float* cross_product(Vector3 vec1, Vector3 vec2, Vector3 out); 00034 // float dot_product(Vector3 vec1, Vector3 vec2); 00035 // float magsq(Vector3 vec); 00036 // float* vecsub(Vector3 vec1, Vector3 vec2, Vector3 out) 00037 // float* scalar_mul(Vector3 vec, float scalar, Vector3 out) 00038 00039 #endif /* _VECTOR3_H */
Generated on Tue Jul 12 2022 20:09:03 by
1.7.2
