@three3d/tools
Version:
@three3d/tools 提供了 ThreeJS 常用的工具库
31 lines (17 loc) • 1.18 kB
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@three3d/tools](./tools.md) > [discriminateRelationshipOfRay\_LineSegment](./tools.discriminaterelationshipofray_linesegment.md)
## discriminateRelationshipOfRay\_LineSegment() function
判别射线和线段的位置关系
**Signature:**
```typescript
export declare function discriminateRelationshipOfRay_LineSegment<Vec extends VectorInstance>(ray: [Vec, Vec], lineSegment: [Vec, Vec]): GeometricRelationship;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| ray | \[Vec, Vec\] | 射线,第一个点射线的起点,第二个点为射线所经过的任意一点(注意,不是射线的方向) |
| lineSegment | \[Vec, Vec\] | 线段 |
**Returns:**
[GeometricRelationship](./tools.geometricrelationship.md)
## Remarks
有以下几种情况: - Contain:包含;线段包含在射线里; - Tangency:相切;射线与线段共线,但射线并不完全包含线段; - Dissociation:相离:线段与射线没有重合的部分; - Intersect;相交;射线和线段相交;