Package: gsk

Function gsk:path-point-tangent

Lambda List

gsk:path-point-tangent (point path direction tangent)

Arguments

point -- a gsk:path-point instance
path -- a gsk:path instance with the path that point is on
direction -- a gsk:path-direction value with the direction for which to return the tangent
tangent -- a graphene:vec2-t instance for the tangent at the point

Return Value

The graphene:vec2-t instance.

Details

Gets the tangent of the path at the point. Note that certain points on a path may not have a single tangent, such as sharp turns. At such points, there are two tangents - the direction of the path going into the point, and the direction coming out of it. The direction argument lets you choose which one to get.

If the path is just a single point, for example, a circle with radius zero, then tangent is set to 0, 0.

If you want to orient something in the direction of the path, the gsk:path-point-rotation function may be more convenient to use.

Since 4.14
 

See also

#2024-11-9