Table of Contents

NAME

QccTrianglePrint, QccTriangleBoundingBox, QccTrianglePointInside, QccTriangleCreateAffineTransform - miscellaneous 2D triangle routines

SYNOPSIS

#include "libQccPack.h"

void QccTrianglePrint(const QccTriangle *triangle);

int QccTriangleBoundingBox(const QccTriangle *triangle, QccPoint *box_max, QccPoint *box_min);

int QccTrianglePointInside(const QccTriangle *triangle, const QccPoint *point);

int QccTriangleCreateAffineTransform(const QccTriangle *triangle1, const QccTriangle *triangle2, QccMatrix transform);

DESCRIPTION

QccPack provides the QccTriangle data structure to represent a triangle in the 2D plane.

DATA STRUCTURE

QccTriangle data structure consists of three points and is defined as:

typedef struct
{
QccPoint vertices[3];
} QccTriangle;

The fields of QccTriangle are as follows:

vertices
An array of the three vertices of the triangle.

ROUTINES

QccTrianglePrint() prints the three vertices of triangle to stdout.

QccTriangleBoundingBox() determines the bounding box of triangle. The bounding box is defined as the smallest rectangle that encloses all three vertices of triangle. QccTriangleBoundingBox() returns the bounding box by specifying the points of the upper-left (box_max) and lower-right (box_min) corners of the bounding box.

QccTrianglePointInside() returns 1 if point lies within the interior of triangle (i.e., triangle encloses point), and 0 if point is outside of triangle.

QccTriangleCreateAffineTransform() determines an affine transform, affine_transform, that maps points in triangle1 into triangle2. affine_transform should be a 3 x 3 matrix allocated prior to calling QccTriangleCreateAffineTransform()

SEE ALSO

QccPoint(3) , QccPack(3)

Y. Altunbasak, A. M. Tekalp, and G. Bozdagi, "Two-Dimensional Object-based Coding Using a Content-based Mesh and Affine Motion Parameterization," in Proceedings of the International Conference on Image Processing, Washington, DC, October 1995, pp. 394 397.

AUTHOR

Copyright (C) 1997-2021 James E. Fowler


Table of Contents



Get QccPack at SourceForge.net. Fast, secure and Free Open Source software downloads