4D Vectors

Double precision

union ksl_vec4_t
#include <vector.h>

double precision 4x1 vector representing a 3x1 vector with a homogeneous coordinate (w) appended.

Typically used for nonlinear transformations such as camera projections.

Public Members

double at[4]
struct ksl_vec4_t::[anonymous] [anonymous]

anonymous union allows accessing vector quantities at specified index

ksl_vec3_t r
double x
double y
double z
double w

homogeneous coordinate of 4d vector

struct ksl_vec4_t::[anonymous] [anonymous]

anonymous union allows x, y, z, w vector components of 4d vector by descriptive name or 3d vector component

ksl_vec4_t ksl_vec4(const double x, const double y, const double z, const double w)

vec4 constructor

ksl_vec4_t *ksl_vec4_alloc(int)

initialize n ksl_vec4_t double precision vectors datastructures on the heap

double ksl_vec4_l2norm(const ksl_vec4_t *v)
void ksl_vec4_normalize(ksl_vec4_t *v)
void ksl_vec4_normalized(const ksl_vec4_t *v, ksl_vec4_t *vo)
void ksl_vec4_scale(ksl_vec4_t *v, const double)
void ksl_vec4_scaled(const ksl_vec4_t *v, const double, ksl_vec4_t *vo)
void ksl_vec4_copy(const ksl_vec4_t *vi, ksl_vec4_t *vo)
void ksl_vec4_swap(ksl_vec4_t *v1, ksl_vec4_t *v2)
void ksl_vec4_inverted(const ksl_vec4_t *vi, ksl_vec4_t *vo)
void ksl_vec4_invert(ksl_vec4_t *vi)

Single precision

union ksl_vec4f_t
#include <vector.h>

single precision 4x1 vector representing a 3x1 vector with a homogeneous coordinate (w) appended.

Typically used for nonlinear transformations such as camera projections.

Public Members

float at[4]
struct ksl_vec4f_t::[anonymous] [anonymous]

anonymous union allows accessing vector quantities at specified index

ksl_vec3f_t r
float x
float y
float z
float w

homogeneous coordinate of 4d vector

struct ksl_vec4f_t::[anonymous] [anonymous]

anonymous union allows x, y, z, w vector components of 4d vector by descriptive name or 3d vector component

ksl_vec4f_t ksl_vec4f(const float x, const float y, const float z, const float w)

vec4f constructor

ksl_vec4f_t *ksl_vec4f_alloc(int)

initialize n ksl_vec4f_t single precision vectors datastructures on the heap

float ksl_vec4f_l2norm(const ksl_vec4f_t *v)
void ksl_vec4f_normalize(ksl_vec4f_t *v)
void ksl_vec4f_normalized(const ksl_vec4f_t *v, ksl_vec4f_t *vo)
void ksl_vec4f_scale(ksl_vec4f_t *v, const float)
void ksl_vec4f_scaled(const ksl_vec4f_t *v, const float, ksl_vec4f_t *vo)
void ksl_vec4f_copy(const ksl_vec4f_t *vi, ksl_vec4f_t *vo)
void ksl_vec4f_swap(ksl_vec4f_t *v1, ksl_vec4f_t *v2)
void ksl_vec4f_inverted(const ksl_vec4f_t *vi, ksl_vec4f_t *vo)
void ksl_vec4f_invert(ksl_vec4f_t *vi)

Integer

union ksl_vec4i_t

Public Members

int at[4]
struct ksl_vec4i_t::[anonymous] [anonymous]

anonymous union allows accessing vector quantities at specified index

ksl_vec3i_t r
int x
int y
int z
int w

homogeneous coordinate of 4d vector

struct ksl_vec4i_t::[anonymous] [anonymous]

anonymous union allows x, y, z, w vector components of 4d vector by descriptive name or 3d vector component

ksl_vec4i_t ksl_vec4i(const int x, const int y, const int z, const int w)

vec4i constructor

ksl_vec4i_t *ksl_vec4i_alloc(int)

initialize n ksl_vec4i_t vectors of integers on the heap