al_calculate_arc - Online Linux Manual PageSection : 3
Updated :
Source : Allegro reference manual
Note :
NAMEal_calculate_arc − Allegro 5 API
SYNOPSIS
#include <allegro5/allegro_primitives.h>
void al_calculate_arc(float* dest, int stride, float cx, float cy,
float rx, float ry, float start_theta, float delta_theta, float thickness,
int num_points)
DESCRIPTIONWhen thickness <= 0 this function computes positions of num_points regularly spaced points on an elliptical arc. When thickness > 0 this function computes two sets of points, obtained as follows: the first set is obtained by taking the points computed in the thickness <= 0 case and shifting them by thickness / 2 outward, in a direction perpendicular to the arc curve. The second set is the same, but shifted thickness / 2 inward relative to the arc. The two sets of points are interleaved in the destination buffer (i.e. the first pair of points will be collinear with the arc center, the first point of the pair will be farther from the center than the second point; the next pair will also be collinear, but at a different angle and so on). The destination buffer dest is interpreted as a set of regularly spaced pairs of floats, each pair holding the coordinates of the corresponding point on the arc. The two floats in the pair are adjacent, and the distance (in bytes) between the addresses of the first float in two successive pairs is stride. For example, if you have a tightly packed array of floats with no spaces between pairs, then stride will be exactly 2 * sizeof(float). Example with thickness <= 0:
const int num_points = 4;
float points[num_points][2];
al_calculate_arc(&points[0][0], 2 * sizeof(float), 0, 0, 10, 10, 0, ALLEGRO_PI / 2, 0, num_points);
assert((int)points[0][0] == 10);
assert((int)points[0][1] == 0);
assert((int)points[num_points − 1][0] == 0);
assert((int)points[num_points − 1][1] == 10);
Example with thickness > 0:
const int num_points = 4;
float points[num_points * 2][2];
al_calculate_arc(&points[0][0], 2 * sizeof(float), 0, 0, 10, 10, 0, ALLEGRO_PI / 2, 2, num_points);
assert((int)points[0][0] == 11);
assert((int)points[0][1] == 0);
assert((int)points[1][0] == 9);
assert((int)points[1][1] == 0);
assert((int)points[(num_points − 1) * 2][0] == 0);
assert((int)points[(num_points − 1) * 2][1] == 11);
assert((int)points[(num_points − 1) * 2 + 1][0] == 0);
assert((int)points[(num_points − 1) * 2 + 1][1] == 9);
Parameters: • dest − The destination buffer • stride − Distance (in bytes) between starts of successive pairs of points • cx, cy − Center of the arc • rx, ry − Radii of the arc • start_theta − The initial angle from which the arc is calculated in radians • delta_theta − Angular span of the arc in radians (pass a negative number to switch direction) • thickness − Thickness of the arc • num_points − The number of points to calculate
SEE ALSOal_draw_arc(3), al_calculate_spline(3), al_calculate_ribbon(3) 0
Johanes Gumabo
Data Size : 13,165 byte
man-al_calculate_arc.3Build : 2024-12-05, 20:55 :
Visitor Screen : x
Visitor Counter ( page / site ) : 3 / 201,645
Visitor ID : :
Visitor IP : 18.227.46.202 :
Visitor Provider : AMAZON-02 :
Provider Position ( lat x lon ) : 39.962500 x -83.006100 : x
Provider Accuracy Radius ( km ) : 1000 :
Provider City : Columbus :
Provider Province : Ohio , : ,
Provider Country : United States :
Provider Continent : North America :
Visitor Recorder : Version :
Visitor Recorder : Library :
Online Linux Manual Page : Version : Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page : Library : lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page : Library : lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base : Version : Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base : Library : lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36
Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.