Commit d104a9b3 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

name parameters "vector1", "vector2" etc. instead of just "a", "b" etc.

2000-02-14  Michael Natterer  <mitch@gimp.org>

	* libgimp/gimpvector.[ch]: name parameters "vector1", "vector2"
	etc. instead of just "a", "b" etc.
parent 260d7b2d
2000-02-14 Michael Natterer <mitch@gimp.org>
* libgimp/gimpvector.[ch]: name parameters "vector1", "vector2"
etc. instead of just "a", "b" etc.
2000-02-14 Michael Natterer <mitch@gimp.org>
* plug-ins/libgck/gck/Makefile.am
......
......@@ -32,140 +32,140 @@
/* Some useful constants */
/*************************/
const GimpVector2 gimp_vector2_zero = { 0.0, 0.0 };
const GimpVector2 gimp_vector2_unit_x = { 1.0, 0.0 };
const GimpVector2 gimp_vector2_unit_y = { 0.0, 1.0 };
static const GimpVector2 gimp_vector2_zero = { 0.0, 0.0 };
static const GimpVector2 gimp_vector2_unit_x = { 1.0, 0.0 };
static const GimpVector2 gimp_vector2_unit_y = { 0.0, 1.0 };
const GimpVector3 gimp_vector3_zero = { 0.0, 0.0, 0.0 };
const GimpVector3 gimp_vector3_unit_x = { 1.0, 0.0, 0.0 };
const GimpVector3 gimp_vector3_unit_y = { 0.0, 1.0, 0.0 };
const GimpVector3 gimp_vector3_unit_z = { 0.0, 0.0, 1.0 };
static const GimpVector3 gimp_vector3_zero = { 0.0, 0.0, 0.0 };
static const GimpVector3 gimp_vector3_unit_x = { 1.0, 0.0, 0.0 };
static const GimpVector3 gimp_vector3_unit_y = { 0.0, 1.0, 0.0 };
static const GimpVector3 gimp_vector3_unit_z = { 0.0, 0.0, 1.0 };
/**************************************/
/* Three dimensional vector functions */
/**************************************/
gdouble
gimp_vector2_inner_product (GimpVector2 *a,
GimpVector2 *b)
gimp_vector2_inner_product (GimpVector2 *vector1,
GimpVector2 *vector2)
{
g_assert (a != NULL);
g_assert (b != NULL);
g_assert (vector1 != NULL);
g_assert (vector2 != NULL);
return (a->x * b->x + a->y * b->y);
return (vector1->x * vector2->x + vector1->y * vector2->y);
}
GimpVector2
gimp_vector2_cross_product (GimpVector2 *a,
GimpVector2 *b)
gimp_vector2_cross_product (GimpVector2 *vector1,
GimpVector2 *vector2)
{
GimpVector2 normal;
g_assert (a != NULL);
g_assert (b != NULL);
g_assert (vector1 != NULL);
g_assert (vector2 != NULL);
normal.x = a->x * b->y - a->y * b->x;
normal.y = a->y * b->x - a->x * b->y;
normal.x = vector1->x * vector2->y - vector1->y * vector2->x;
normal.y = vector1->y * vector2->x - vector1->x * vector2->y;
return normal;
}
gdouble
gimp_vector2_length (GimpVector2 *a)
gimp_vector2_length (GimpVector2 *vector)
{
g_assert (a != NULL);
g_assert (vector != NULL);
return (sqrt (a->x * a->x + a->y * a->y));
return (sqrt (vector->x * vector->x + vector->y * vector->y));
}
void
gimp_vector2_normalize (GimpVector2 *a)
gimp_vector2_normalize (GimpVector2 *vector)
{
gdouble len;
g_assert (a != NULL);
g_assert (vector != NULL);
len = gimp_vector2_length (a);
len = gimp_vector2_length (vector);
if (len != 0.0)
{
len = 1.0 / len;
a->x = a->x * len;
a->y = a->y * len;
vector->x *= len;
vector->y *= len;
}
else
{
*a = gimp_vector2_zero;
*vector = gimp_vector2_zero;
}
}
void
gimp_vector2_mul (GimpVector2 *a,
double b)
gimp_vector2_mul (GimpVector2 *vector,
gdouble factor)
{
g_assert (a != NULL);
g_assert (vector != NULL);
a->x = a->x * b;
a->y = a->y * b;
vector->x *= factor;
vector->y *= factor;
}
void
gimp_vector2_sub (GimpVector2 *c,
GimpVector2 *a,
GimpVector2 *b)
gimp_vector2_sub (GimpVector2 *result,
GimpVector2 *vector1,
GimpVector2 *vector2)
{
g_assert (a != NULL);
g_assert (b != NULL);
g_assert (c != NULL);
g_assert (vector1 != NULL);
g_assert (vector2 != NULL);
g_assert (result != NULL);
c->x = a->x - b->x;
c->y = a->y - b->y;
result->x = vector1->x - vector2->x;
result->y = vector1->y - vector2->y;
}
void
gimp_vector2_set (GimpVector2 *a,
gimp_vector2_set (GimpVector2 *vector,
gdouble x,
gdouble y)
{
g_assert (a != NULL);
g_assert (vector != NULL);
a->x = x;
a->y = y;
vector->x = x;
vector->y = y;
}
void
gimp_vector2_add (GimpVector2 *c,
GimpVector2 *a,
GimpVector2 *b)
gimp_vector2_add (GimpVector2 *result,
GimpVector2 *vector1,
GimpVector2 *vector2)
{
g_assert (a != NULL);
g_assert (b != NULL);
g_assert (c != NULL);
g_assert (vector1 != NULL);
g_assert (vector2 != NULL);
g_assert (result != NULL);
c->x = a->x + b->x;
c->y = a->y + b->y;
result->x = vector1->x + vector2->x;
result->y = vector1->y + vector2->y;
}
void
gimp_vector2_neg (GimpVector2 *a)
gimp_vector2_neg (GimpVector2 *vector)
{
g_assert (a != NULL);
g_assert (vector != NULL);
a->x *= -1.0;
a->y *= -1.0;
vector->x *= -1.0;
vector->y *= -1.0;
}
void
gimp_vector2_rotate (GimpVector2 *v,
gimp_vector2_rotate (GimpVector2 *vector,
gdouble alpha)
{
GimpVector2 s;
GimpVector2 result;
g_assert (v != NULL);
g_assert (vector != NULL);
s.x = cos (alpha) * v->x + sin (alpha) * v->y;
s.y = cos (alpha) * v->y - sin (alpha) * v->x;
result.x = cos (alpha) * vector->x + sin (alpha) * vector->y;
result.y = cos (alpha) * vector->y - sin (alpha) * vector->x;
*v = s;
*vector = result;
}
/**************************************/
......@@ -173,151 +173,155 @@ gimp_vector2_rotate (GimpVector2 *v,
/**************************************/
gdouble
gimp_vector3_inner_product (GimpVector3 *a,
GimpVector3 *b)
gimp_vector3_inner_product (GimpVector3 *vector1,
GimpVector3 *vector2)
{
g_assert (a != NULL);
g_assert (b != NULL);
g_assert (vector1 != NULL);
g_assert (vector2 != NULL);
return (a->x * b->x + a->y * b->y + a->z * b->z);
return (vector1->x * vector2->x +
vector1->y * vector2->y +
vector1->z * vector2->z);
}
GimpVector3
gimp_vector3_cross_product (GimpVector3 *a,
GimpVector3 *b)
gimp_vector3_cross_product (GimpVector3 *vector1,
GimpVector3 *vector2)
{
GimpVector3 normal;
g_assert (a != NULL);
g_assert (b != NULL);
g_assert (vector1 != NULL);
g_assert (vector2 != NULL);
normal.x = a->y * b->z - a->z * b->y;
normal.y = a->z * b->x - a->x * b->z;
normal.z = a->x * b->y - a->y * b->x;
normal.x = vector1->y * vector2->z - vector1->z * vector2->y;
normal.y = vector1->z * vector2->x - vector1->x * vector2->z;
normal.z = vector1->x * vector2->y - vector1->y * vector2->x;
return normal;
}
gdouble
gimp_vector3_length (GimpVector3 *a)
gimp_vector3_length (GimpVector3 *vector)
{
g_assert (a != NULL);
g_assert (vector != NULL);
return (sqrt (a->x * a->x + a->y * a->y + a->z * a->z));
return (sqrt (vector->x * vector->x +
vector->y * vector->y +
vector->z * vector->z));
}
void
gimp_vector3_normalize (GimpVector3 *a)
gimp_vector3_normalize (GimpVector3 *vector)
{
gdouble len;
g_assert (a != NULL);
g_assert (vector != NULL);
len = gimp_vector3_length (a);
len = gimp_vector3_length (vector);
if (len != 0.0)
{
len = 1.0 / len;
a->x = a->x * len;
a->y = a->y * len;
a->z = a->z * len;
vector->x *= len;
vector->y *= len;
vector->z *= len;
}
else
{
*a = gimp_vector3_zero;
*vector = gimp_vector3_zero;
}
}
void
gimp_vector3_mul (GimpVector3 *a,
gdouble b)
gimp_vector3_mul (GimpVector3 *vector,
gdouble factor)
{
g_assert (a != NULL);
g_assert (vector != NULL);
a->x = a->x * b;
a->y = a->y * b;
a->z = a->z * b;
vector->x *= factor;
vector->y *= factor;
vector->z *= factor;
}
void
gimp_vector3_sub (GimpVector3 *c,
GimpVector3 *a,
GimpVector3 *b)
gimp_vector3_sub (GimpVector3 *result,
GimpVector3 *vector1,
GimpVector3 *vector2)
{
g_assert (a != NULL);
g_assert (b != NULL);
g_assert (c != NULL);
g_assert (vector1 != NULL);
g_assert (vector2 != NULL);
g_assert (result != NULL);
c->x = a->x - b->x;
c->y = a->y - b->y;
c->z = a->z - b->z;
result->x = vector1->x - vector2->x;
result->y = vector1->y - vector2->y;
result->z = vector1->z - vector2->z;
}
void
gimp_vector3_set (GimpVector3 *a,
gimp_vector3_set (GimpVector3 *vector,
gdouble x,
gdouble y,
gdouble z)
{
g_assert (a != NULL);
g_assert (vector != NULL);
a->x = x;
a->y = y;
a->z = z;
vector->x = x;
vector->y = y;
vector->z = z;
}
void
gimp_vector3_add (GimpVector3 *c,
GimpVector3 *a,
GimpVector3 *b)
gimp_vector3_add (GimpVector3 *result,
GimpVector3 *vector1,
GimpVector3 *vector2)
{
g_assert (a != NULL);
g_assert (b != NULL);
g_assert (c != NULL);
g_assert (vector1 != NULL);
g_assert (vector2 != NULL);
g_assert (result != NULL);
c->x = a->x + b->x;
c->y = a->y + b->y;
c->z = a->z + b->z;
result->x = vector1->x + vector2->x;
result->y = vector1->y + vector2->y;
result->z = vector1->z + vector2->z;
}
void
gimp_vector3_neg (GimpVector3 *a)
gimp_vector3_neg (GimpVector3 *vector)
{
g_assert (a != NULL);
g_assert (vector != NULL);
a->x *= -1.0;
a->y *= -1.0;
a->z *= -1.0;
vector->x *= -1.0;
vector->y *= -1.0;
vector->z *= -1.0;
}
void
gimp_vector3_rotate (GimpVector3 *v,
gimp_vector3_rotate (GimpVector3 *vector,
gdouble alpha,
gdouble beta,
gdouble gamma)
{
GimpVector3 s, t;
g_assert (v != NULL);
g_assert (vector != NULL);
/* First we rotate it around the Z axis (XY plane).. */
/* ================================================= */
s.x = cos (alpha) * v->x + sin (alpha) * v->y;
s.y = cos (alpha) * v->y - sin (alpha) * v->x;
s.x = cos (alpha) * vector->x + sin (alpha) * vector->y;
s.y = cos (alpha) * vector->y - sin (alpha) * vector->x;
/* ..then around the Y axis (XZ plane).. */
/* ===================================== */
t = s;
v->x = cos (beta) *t.x + sin (beta) * v->z;
s.z = cos (beta) *v->z - sin (beta) * t.x;
vector->x = cos (beta) *t.x + sin (beta) * vector->z;
s.z = cos (beta) *vector->z - sin (beta) * t.x;
/* ..and at last around the X axis (YZ plane) */
/* ========================================== */
v->y = cos (gamma) * t.y + sin (gamma) * s.z;
v->z = cos (gamma) * s.z - sin (gamma) * t.y;
vector->y = cos (gamma) * t.y + sin (gamma) * s.z;
vector->z = cos (gamma) * s.z - sin (gamma) * t.y;
}
/******************************************************************/
......
......@@ -52,50 +52,50 @@ struct _GimpVector4
/* Two dimensional vector functions */
/* ================================ */
gdouble gimp_vector2_inner_product (GimpVector2 *a,
GimpVector2 *b);
GimpVector2 gimp_vector2_cross_product (GimpVector2 *a,
GimpVector2 *b);
double gimp_vector2_length (GimpVector2 *a);
void gimp_vector2_normalize (GimpVector2 *a);
void gimp_vector2_mul (GimpVector2 *a,
gdouble b);
void gimp_vector2_sub (GimpVector2 *c,
GimpVector2 *a,
GimpVector2 *b);
void gimp_vector2_set (GimpVector2 *a,
gdouble gimp_vector2_inner_product (GimpVector2 *vector1,
GimpVector2 *vector2);
GimpVector2 gimp_vector2_cross_product (GimpVector2 *vector1,
GimpVector2 *vector2);
gdouble gimp_vector2_length (GimpVector2 *vector);
void gimp_vector2_normalize (GimpVector2 *vector);
void gimp_vector2_mul (GimpVector2 *vector,
gdouble factor);
void gimp_vector2_sub (GimpVector2 *result,
GimpVector2 *vector1,
GimpVector2 *vector2);
void gimp_vector2_set (GimpVector2 *vector,
gdouble x,
gdouble y);
void gimp_vector2_add (GimpVector2 *c,
GimpVector2 *a,
GimpVector2 *b);
void gimp_vector2_neg (GimpVector2 *a);
void gimp_vector2_rotate (GimpVector2 *v,
void gimp_vector2_add (GimpVector2 *result,
GimpVector2 *vector1,
GimpVector2 *vector2);
void gimp_vector2_neg (GimpVector2 *vector);
void gimp_vector2_rotate (GimpVector2 *vector,
gdouble alpha);
/* Three dimensional vector functions */
/* ================================== */
gdouble gimp_vector3_inner_product (GimpVector3 *a,
GimpVector3 *b);
GimpVector3 gimp_vector3_cross_product (GimpVector3 *a,
GimpVector3 *b);
double gimp_vector3_length (GimpVector3 *a);
void gimp_vector3_normalize (GimpVector3 *a);
void gimp_vector3_mul (GimpVector3 *a,
gdouble b);
void gimp_vector3_sub (GimpVector3 *c,
GimpVector3 *a,
GimpVector3 *b);
void gimp_vector3_set (GimpVector3 *a,
gdouble gimp_vector3_inner_product (GimpVector3 *vector1,
GimpVector3 *vector2);
GimpVector3 gimp_vector3_cross_product (GimpVector3 *vector1,
GimpVector3 *vector2);
gdouble gimp_vector3_length (GimpVector3 *vector);
void gimp_vector3_normalize (GimpVector3 *vector);
void gimp_vector3_mul (GimpVector3 *vector,
gdouble factor);
void gimp_vector3_sub (GimpVector3 *result,
GimpVector3 *vector1,
GimpVector3 *vector2);
void gimp_vector3_set (GimpVector3 *vector,
gdouble x,
gdouble y,
gdouble z);
void gimp_vector3_add (GimpVector3 *c,
GimpVector3 *a,
GimpVector3 *b);
void gimp_vector3_neg (GimpVector3 *a);
void gimp_vector3_rotate (GimpVector3 *v,
void gimp_vector3_add (GimpVector3 *result,
GimpVector3 *vector1,
GimpVector3 *vector2);
void gimp_vector3_neg (GimpVector3 *vector);
void gimp_vector3_rotate (GimpVector3 *vector,
gdouble alpha,
gdouble beta,
gdouble gamma);
......
2000-02-14 Michael Natterer <mitschel@cs.tu-berlin.de>
* de.po: s/Zurcksetzen/Standard/. This way many action_areas are
nicer.
Sun Feb 13 12:59:40 CET 2000 Sven Neumann <sven@gimp.org>
* de.po: updated german translation
......
......@@ -291,7 +291,7 @@ msgstr "OK"
#: app/threshold.c:273 app/tools.c:1045 app/transform_core.c:413
#: modules/colorsel_water.c:634
msgid "Reset"
msgstr "Zurcksetzen"
msgstr "Standard"
#. Create the brightness scale widget
#: app/brightness_contrast.c:234
......@@ -2070,7 +2070,7 @@ msgstr "
#: app/gradient.c:5250
msgid "Blend endpoints' opacity"
msgstr "bergang zwischen der Endpunktdeckung"
msgstr "bergang zwischen der Endpunktdeckkraft"
#: app/gradient.c:5418
msgid "Replicate"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment