double tangente(int n) { double res; double x; x = deg_rad(n); res = sinus(x) / cosinus(x); return (res); }
static void run (const gchar *name, gint nparams, const GimpParam *param, gint *nreturn_vals, GimpParam **return_vals) { static GimpParam values[1]; GimpPDBStatusType status = GIMP_PDB_SUCCESS; GimpRunMode run_mode; GimpDrawable *drawable; /* Setting mandatory output values */ *nreturn_vals = 1; *return_vals = values; values[0].type = GIMP_PDB_STATUS; values[0].data.d_status = status; /* Getting run_mode - we won't display a dialog if * we are in NONINTERACTIVE mode */ run_mode = param[0].data.d_int32; /* Get the specified drawable */ drawable = gimp_drawable_get (param[2].data.d_drawable); gimp_progress_init ("Cosinus ..."); /* Let's time blur * * GTimer timer = g_timer_new time (); */ cosinus (drawable); /* g_print ("blur() took %g seconds.\n", g_timer_elapsed (timer)); * g_timer_destroy (timer); */ gimp_displays_flush (); gimp_drawable_detach (drawable); }
t_vect rot(t_vect v, t_vect r) { double tmp; tmp = v.y; r.x = (int)r.x % 360; if (r.x < 0) r.x += 360; v.y = tmp * cosinus(r.x) - v.z * sinus(r.x); v.z = tmp * sinus(r.x) + v.z * cosinus(r.x); tmp = v.x; r.y = (int)r.y % 360; if (r.y < 0) r.y += 360; v.x = tmp * cosinus(r.y) - v.z * sinus(r.y); v.z = tmp * sinus(r.y) + v.z * cosinus(r.y); tmp = v.x; r.z = (int)r .z % 360; if (r.z < 0) r.z += 360; v.x = tmp * cosinus(r.z) - v.y *sinus(r.z); v.y = tmp * sinus(r.z) + v.y *cosinus(r.z); return (v); }