在Sympy中,该函数
Plane.projection_line()
用于将给定线通过包含该线的法线平面投影到给定平面上。用法: Plane.projection_line(line) 参数: line: LinearEntity or LinearEntity3D 返回: Point3D, Line3D, Ray3D or Segment3D
范例1:
# import sympy and Plane, Line, Line3D, Point, Point3D
from sympy import Plane, Line, Line3D, Point, Point3D
p = Line(Point(1, 2), Point(2, 3))
# using Plane()
p1 = Plane(Point3D(1, 2, 3), normal_vector =(1, 0, 1))
# using projection_line()
projectionLine = p1.projection_line(p)
print(projectionLine)
输出:
Line3D(Point3D(5/2, 2, 3/2), Point3D(3, 3, 1))
范例2:
# import sympy and Plane, Line, Line3D, Point, Point3D
from sympy import Plane, Line, Line3D, Point, Point3D
p = Line3D(Point3D(1, 2, 3), Point(0, 0, 0))
# using Plane()
p2 = Plane(Point3D(1, 1, 1), normal_vector =(0, 0, 0))
# using projection_line()
projectionLine = p2.projection_line(p)
print(projectionLine)
输出:
Line3D(Point3D(1, 2, 3), Point3D(2, 0, 2))
相关用法
- Python sympy.cos()用法及代码示例
- Python sympy.lcm()用法及代码示例
- Python sympy.lcm()用法及代码示例
- Python sympy.has()用法及代码示例
- Python sympy.gcd()用法及代码示例
- Python sympy.Mod()用法及代码示例
- Python sympy.sec()用法及代码示例
- Python sympy.apart()用法及代码示例
- Python sympy.tan()用法及代码示例
- Python sympy.gcd()用法及代码示例
- Python sympy.sin()用法及代码示例
- Python sympy.Add()用法及代码示例
- Python sympy.Mul()用法及代码示例
- Python sympy.S()用法及代码示例
- Python sympy.Add()用法及代码示例
注:本文由纯净天空筛选整理自ravikishor大神的英文原创作品 Python | Sympy Plane.projection_line() method。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。