 verify/neighborhood - Maple Programming Help

Home : Support : Online Help : Programming : Logic : Boolean : verify : verify/neighborhood

verify/neighborhood

verify that a point is within a neighborhood of another

 Calling Sequence verify(expr1, expr2, neighborhood(dist, opt1, opt2, ...)) verify(expr1, expr2, neighbourhood(dist, opt1, opt2, ...))

Parameters

 expr1, expr2 - algebraic objects or lists of algebraic objects dist - algebraic object with a non-negative signum opt1, opt2, ... - optional arguments

Description

 • The verify(expr1, expr2, neighborhood(dist, opt1, opt2, ...)) calling sequence returns true if it can determine that the distance between expr1 and expr2 is less than dist.
 • By default, the distance is measured in Euclidean space, that is, the square root of the sum of the squares of the differences between the points.  This can be modified by using the option $p=N$, where $N$ is between $0$ and $\mathrm{\infty }$, inclusive. This distance is given by:

${\left(\sum _{i=1}^{N}{\left|{\mathrm{expr1}}_{i}-{\mathrm{expr2}}_{i}\right|}^{p}\right)}^{\frac{1}{p}}$

 • By default, the neighborhood is open, that is, the distance must be strictly less than dist. This can be modified by using the option closed to indicate that the distance is less than or equal to dist, or by using boundary to indicate that the distance is exactly equal to dist.
 • This verification is symmetric.
 • If either expr1 or expr2 is not of type algebraic then false is returned.

Examples

 > $\mathrm{verify}\left(\mathrm{\pi },3,'\mathrm{neighborhood}\left(1\right)'\right)$
 ${\mathrm{true}}$ (1)
 > $\mathrm{verify}\left(3,4,'\mathrm{neighborhood}\left(1\right)'\right)$
 ${\mathrm{false}}$ (2)
 > $\mathrm{verify}\left(3,4,'\mathrm{neighborhood}\left(1,\mathrm{open}\right)'\right)$
 ${\mathrm{false}}$ (3)
 > $\mathrm{verify}\left(\left[\frac{\mathrm{sqrt}\left(2\right)}{2},\frac{\mathrm{sqrt}\left(2\right)}{2}\right],\left[0,0\right],'\mathrm{neighborhood}\left(1\right)'\right)$
 ${\mathrm{false}}$ (4)
 > $\mathrm{verify}\left(\left[\frac{\mathrm{sqrt}\left(2\right)}{2},\frac{\mathrm{sqrt}\left(2\right)}{2}\right],\left[0,0\right],'\mathrm{neighborhood}\left(1,\mathrm{closed}\right)'\right)$
 ${\mathrm{true}}$ (5)
 > $\mathrm{verify}\left(\left[\frac{\mathrm{sqrt}\left(2\right)}{2},\frac{\mathrm{sqrt}\left(2\right)}{2}\right],\left[0,0\right],'\mathrm{neighborhood}\left(1,p=3\right)'\right)$
 ${\mathrm{true}}$ (6)
 > $\mathrm{verify}\left(\left[1,1\right],\left[0,0\right],'\mathrm{neighborhood}\left(1,p=\mathrm{\infty }\right)'\right)$
 ${\mathrm{false}}$ (7)
 > $\mathrm{verify}\left(\left[1,1\right],\left[0,0\right],'\mathrm{neighborhood}\left(1,p=\mathrm{\infty },\mathrm{closed}\right)'\right)$
 ${\mathrm{true}}$ (8)