# calc_spline - Man Page

Calculates a series of values along a Bezier spline. Allegro game programming library.

## Synopsis

`#include <allegro.h>`

`void calc_spline(const int points, int npts, int *x, int *y);`

## Description

Calculates a series of npts values along a Bezier spline, storing them in  the output x and y arrays. The Bezier curve is specified by the four x/y  control points in the points array: points and points contain the  coordinates of the first control point, points and points are the  second point, etc. Control points 0 and 3 are the ends of the spline, and  points 1 and 2 are guides. The curve probably won't pass through points 1  and 2, but they affect the shape of the curve between points 0 and 3 (the  lines p0-p1 and p2-p3 are tangents to the spline). The easiest way to  think of it is that the curve starts at p0, heading in the direction of  p1, but curves round so that it arrives at p3 from the direction of p2.  In addition to their role as graphics primitives, spline curves can be  useful for constructing smooth paths around a series of control points,  as in exspline.c.
{"ft_lang_label":"__label__en","ft_lang_prob":0.90323216,"math_prob":0.9907735,"size":1174,"snap":"2022-05-2022-21","text_gpt3_token_len":307,"char_repetition_ratio":0.15897436,"word_repetition_ratio":0.0,"special_character_ratio":0.24531516,"punctuation_ratio":0.11065574,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.97957265,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-05-28T23:39:02Z\",\"WARC-Record-ID\":\"<urn:uuid:a23ceda7-7bea-42e6-bdc1-bfcec864061e>\",\"Content-Length\":\"5509\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:a43f72ff-2790-4d00-9ba9-0d25d6f3e063>\",\"WARC-Concurrent-To\":\"<urn:uuid:ff3f89f9-86e4-488f-b5df-e36a1656b436>\",\"WARC-IP-Address\":\"172.67.150.178\",\"WARC-Target-URI\":\"https://www.mankier.com/3/calc_spline\",\"WARC-Payload-Digest\":\"sha1:5J4ZYGDFN3J2ZR4TB7I4H26D7ZGWSD6X\",\"WARC-Block-Digest\":\"sha1:37OEEUCOUUFKTT5QPISK3UQDHA3WAEIK\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-21/CC-MAIN-2022-21_segments_1652663021405.92_warc_CC-MAIN-20220528220030-20220529010030-00673.warc.gz\"}"}