#ifndef SWIFT_MATHS_VEC2F_H
#define SWIFT_MATHS_VEC2F_H

#include <swift/stdlib.h>

#include <swift/maths/api.h>

typedef union swift_mat2f_t swift_mat2f_t;
typedef union swift_vec2f_t swift_vec2f_t;
typedef union swift_vec2u_t swift_vec2u_t;

union swift_vec2f_t {
	struct {
		float x, y;
	}xy;

	struct {
		float w, h;
	}wh;

	float data[2];
};

union swift_vec2u_t {
	struct {
		uint32_t x, y;
	}xy;

	struct {
		uint32_t w, h;
	}wh;

	uint32_t data[2];
};

#define SWIFT_VEC2F(...) ((swift_vec2f_t){__VA_ARGS__})

SWIFT_MATHS_API swift_vec2f_t swift_vec2f_neg(swift_vec2f_t vec);
SWIFT_MATHS_API swift_vec2f_t swift_vec2f_add_scalar(swift_vec2f_t lhs,
	float rhs);
SWIFT_MATHS_API swift_vec2f_t swift_vec2f_sub_scalar(swift_vec2f_t lhs,
	float rhs);
SWIFT_MATHS_API swift_vec2f_t swift_vec2f_mul_scalar(swift_vec2f_t lhs,
	float rhs);
SWIFT_MATHS_API swift_vec2f_t swift_vec2f_div_scalar(swift_vec2f_t lhs,
	float rhs);
SWIFT_MATHS_API swift_vec2f_t swift_vec2f_add(swift_vec2f_t lhs,
	swift_vec2f_t rhs);
SWIFT_MATHS_API swift_vec2f_t swift_vec2f_sub(swift_vec2f_t lhs,
	swift_vec2f_t rhs);
SWIFT_MATHS_API float swift_vec2f_dot(swift_vec2f_t lhs, swift_vec2f_t rhs);
SWIFT_MATHS_API swift_mat2f_t swift_vec2f_tensor(swift_vec2f_t lhs,
	swift_vec2f_t rhs);
SWIFT_MATHS_API float swift_vec2f_norm(swift_vec2f_t vec);
SWIFT_MATHS_API swift_vec2f_t swift_vec2f_normalise(swift_vec2f_t vec);
SWIFT_MATHS_API float swift_vec2f_length_sq(swift_vec2f_t vec);
SWIFT_MATHS_API float swift_vec2f_length(swift_vec2f_t vec);
#endif /* SWIFT_MATHS_VEC2F_H */
