Function | Package: cg | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 10.1 Unrevised from 10.0 to 10.1. 10.0 version

## on-line-segment-p

Arguments: position end1 end2 &key (margin 4)

Returns true if position is on the line segment that extends from end1 to end2, within a margin of error specified by the margin keyword argument, and otherwise returns `nil`. position, end1, and end2 must all be position objects (see make-position).

The margin keyword argument must be a non-negative real number, and is typically a small positive value to allow the user to click on a line that is drawn in a window without having to click precisely on the line. The default value of 4 allows the user to miss the line by up to 4 pixels on either side; then if a call to this function with the clicked position and the endpoints of the drawn line returns true, then an application can decide that the user clicked on the line and take appropriate action. When the line is more nearly horizontal than vertical, this margin is measured vertically from the line, and otherwise it is measured horizontally from the line.

An error is signaled if end1 and end2 are position= to each other.

See also on-line-segment-x-y-p.

Copyright (c) 1998-2022, Franz Inc. Lafayette, CA., USA. All rights reserved.
This page was not revised from the 10.0 page.
Created 2019.8.20.

|  | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 10.1 Unrevised from 10.0 to 10.1. 10.0 version