Did I find the right examples for you? yes no      Crawl my project      Python Jobs

# py2d.Math.distance_point_lineseg_squared

All Samples(4)  |  Call(4)  |  Derive(0)  |  Import(0)
```Get the shortest distance from a point to a line segment.

This can either be a perpendicular to a point on the line segment or the straight connection of p to one of the end points.

@type p: Vector
@param p: The point to compare to the line segment

@type a: Vector
@param a: The first point on the first line segment
(more...)
```

src/p/y/Py2D-HEAD/py2d/FOV.py   Py2D(Download)
```		def sub_segment(small, big):
return py2d.Math.distance_point_lineseg_squared(small, big, big) < 0.0001 and py2d.Math.distance_point_lineseg_squared(small, big, big) < 0.0001

def segment_in_obs(seg):
```
```		def lineseg_in_radius(seg):
return py2d.Math.distance_point_lineseg_squared(eye, seg, seg) <= radius_squared

obs_segs = filter(lineseg_in_radius, self.obs_segs)

```
```				p = boundary_intersection_points[i]

if py2d.Math.distance_point_lineseg_squared(p, line_segment, line_segment) > 0.0001 and py2d.Math.check_intersect_lineseg_lineseg(eye, p, line_segment, line_segment):
boundary_intersection_points.remove(p)
else:
```