135 lines
2.4 KiB
C
135 lines
2.4 KiB
C
/* LIBPIKA - The PIKA Library
|
|
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
|
|
*
|
|
* pikamathtypes.h
|
|
*
|
|
* This library is free software: you can redistribute it and/or
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
* License as published by the Free Software Foundation; either
|
|
* version 3 of the License, or (at your option) any later version.
|
|
*
|
|
* This library is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
* Lesser General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
* License along with this library. If not, see
|
|
* <https://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
#ifndef __PIKA_MATH_TYPES_H__
|
|
#define __PIKA_MATH_TYPES_H__
|
|
|
|
|
|
#include <libpikabase/pikabasetypes.h>
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
typedef struct _PikaMatrix2 PikaMatrix2;
|
|
typedef struct _PikaMatrix3 PikaMatrix3;
|
|
typedef struct _PikaMatrix4 PikaMatrix4;
|
|
|
|
/**
|
|
* PikaMatrix2
|
|
* @coeff: the coefficients
|
|
*
|
|
* A two by two matrix.
|
|
**/
|
|
struct _PikaMatrix2
|
|
{
|
|
gdouble coeff[2][2];
|
|
};
|
|
|
|
/**
|
|
* PikaMatrix3
|
|
* @coeff: the coefficients
|
|
*
|
|
* A three by three matrix.
|
|
**/
|
|
struct _PikaMatrix3
|
|
{
|
|
gdouble coeff[3][3];
|
|
};
|
|
|
|
/**
|
|
* PikaMatrix4
|
|
* @coeff: the coefficients
|
|
*
|
|
* A four by four matrix.
|
|
**/
|
|
struct _PikaMatrix4
|
|
{
|
|
gdouble coeff[4][4];
|
|
};
|
|
|
|
|
|
typedef struct _PikaVector2 PikaVector2;
|
|
typedef struct _PikaVector3 PikaVector3;
|
|
typedef struct _PikaVector4 PikaVector4;
|
|
|
|
/**
|
|
* PikaVector2:
|
|
* @x: the x axis
|
|
* @y: the y axis
|
|
*
|
|
* A two dimensional vector.
|
|
**/
|
|
struct _PikaVector2
|
|
{
|
|
gdouble x, y;
|
|
};
|
|
|
|
/**
|
|
* PIKA_TYPE_VECTOR2:
|
|
*
|
|
* Boxed type representing a two-dimensional vector.
|
|
*/
|
|
#define PIKA_TYPE_VECTOR2 (pika_vector2_get_type ())
|
|
|
|
GType pika_vector2_get_type (void) G_GNUC_CONST;
|
|
|
|
|
|
/**
|
|
* PikaVector3:
|
|
* @x: the x axis
|
|
* @y: the y axis
|
|
* @z: the z axis
|
|
*
|
|
* A three dimensional vector.
|
|
**/
|
|
struct _PikaVector3
|
|
{
|
|
gdouble x, y, z;
|
|
};
|
|
|
|
/**
|
|
* PIKA_TYPE_VECTOR3:
|
|
*
|
|
* Boxed type representing a three-dimensional vector.
|
|
*/
|
|
#define PIKA_TYPE_VECTOR3 (pika_vector3_get_type ())
|
|
|
|
GType pika_vector3_get_type (void) G_GNUC_CONST;
|
|
|
|
|
|
/**
|
|
* PikaVector4:
|
|
* @x: the x axis
|
|
* @y: the y axis
|
|
* @z: the z axis
|
|
* @w: the w axis
|
|
*
|
|
* A four dimensional vector.
|
|
**/
|
|
struct _PikaVector4
|
|
{
|
|
gdouble x, y, z, w;
|
|
};
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
#endif /* __PIKA_MATH_TYPES_H__ */
|