Appearance
KBE3D / KBCore / Cesium / Intersections2D / computeLineSegmentLineSegmentIntersection
函数: computeLineSegmentLineSegmentIntersection()
computeLineSegmentLineSegmentIntersection(
x00:number,y00:number,x01:number,y01:number,x10:number,y10:number,x11:number,y11:number,result?:Cartesian2):Cartesian2
Compute the intersection between 2 line segments
参数
x00
number
The x coordinate of the first line's first vertex.
y00
number
The y coordinate of the first line's first vertex.
x01
number
The x coordinate of the first line's second vertex.
y01
number
The y coordinate of the first line's second vertex.
x10
number
The x coordinate of the second line's first vertex.
y10
number
The y coordinate of the second line's first vertex.
x11
number
The x coordinate of the second line's second vertex.
y11
number
The y coordinate of the second line's second vertex.
result?
The instance into to which to copy the result. If this parameter is undefined, a new instance is created and returned.
返回
The intersection point, undefined if there is no intersection point or lines are coincident.
示例
ts
const result = Cesium.Intersections2D.computeLineSegmentLineSegmentIntersection(0.0, 0.0, 0.0, 2.0, -1, 1, 1, 1);
// result === new Cesium.Cartesian2(0.0, 1.0);