mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
16 lines
244 B
C
16 lines
244 B
C
#include "IAMVec.h"
|
|
#include <math.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
extern double IAMVec3GetNorm(IAMVec3Ref self) {
|
|
double x = self->x, y = self->y, z = self->z;
|
|
return sqrt(x * x + y * y + z * z);
|
|
}
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|