C-Blocks
view release on metacpan or search on metacpan
examples/prima-ellipse.pl view on Meta::CPAN
buffered => 1,
onPaint => sub {
my ($self, $canvas) = @_;
return $self->repaint if $self->get_paint_state != 1;
$self->clear;
my $rotation = atan2($y - 250, $x - 250);
cblock {
Handle widget_handle = gimme_the_mate($self);
/* Draw an ellipse tilted toward the mouse. Thanks to
* http://www.uwgb.edu/dutchs/Geometry/HTMLCanvas/ObliqueEllipses5.HTM
* for the formula. */
int i;
double theta, theta_inc, theta_0, sin_theta_0, cos_theta_0;
/* get the rotation, set the per-step theta increment */
theta_0 = SvNV($rotation);
theta_inc = 2 * M_PI / N_POINTS;
sin_theta_0 = sin(theta_0);
cos_theta_0 = cos(theta_0);
/* Build the set of points */
examples/prima-lib-ellipse.pl view on Meta::CPAN
buffered => 1,
onPaint => sub {
my ($self, $canvas) = @_;
return $self->repaint if $self->get_paint_state != 1;
$self->clear;
my $rotation = atan2($y - 250, $x - 250);
cblock {
Handle widget_handle = gimme_the_mate($self);
/* Draw an ellipse tilted toward the mouse. Thanks to
* http://www.uwgb.edu/dutchs/Geometry/HTMLCanvas/ObliqueEllipses5.HTM
* for the formula. */
int i;
double theta, theta_inc, theta_0, sin_theta_0, cos_theta_0;
/* get the rotation, set the per-step theta increment */
theta_0 = SvNV($rotation);
theta_inc = 2 * M_PI / N_POINTS;
sin_theta_0 = sin(theta_0);
cos_theta_0 = cos(theta_0);
/* Build the set of points */
examples/primatest.pl view on Meta::CPAN
B_rad = SvNV($B);
x_pt = SvIV($x);
y_pt = SvIV($y);
C_N_x = SvIV($N_x);
C_N_y = SvIV($N_y);
N_points = 200;
Handle widget_handle = gimme_the_mate($self);
/* Draw an ellipse tilted toward the mouse. Thanks to
* http://www.uwgb.edu/dutchs/Geometry/HTMLCanvas/ObliqueEllipses5.HTM
* for the formula. */
int i, j, k;
double theta, theta_inc, theta_0, sin_theta_0, cos_theta_0;
/* set the per-step theta increment */
theta_inc = 2 * M_PI / N_points;
/* Iterate through the number of x and y ellipses to draw */
for (i = 0; i < C_N_x; i++) {
//int x_pos = ...
for (j = 0; j < C_N_y; j++) {
( run in 0.441 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )