Changeset 242


Ignore:
Timestamp:
Jan 19, 2011, 10:23:24 PM (12 years ago)
Author:
sam
Message:

Implement vector square length.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/matrix.h

    r240 r242  
    6161    } \
    6262    \
    63     inline float len() const \
     63    inline T sqlen() const \
    6464    { \
    6565        T acc = 0; \
    6666        for (int n = 0; n < elems; n++) \
    6767            acc += (*this)[n] * (*this)[n]; \
    68         return sqrtf((float)acc); \
     68        return acc; \
     69    } \
     70    \
     71    inline float len() const \
     72    { \
     73        return sqrtf((float)sqlen()); \
    6974    }
    7075
Note: See TracChangeset for help on using the changeset viewer.