1
A
回答
2
一个可以进行例如为:
#!/usr/bin/env python
import math
from shapely.geometry import Point
from shapely.affinity import scale, rotate
#input parameters
A = Point(1, 1)
B = Point(4, 5)
R = 1
d = A.distance(B)
#first, rotate B to B' around A so that |AB'| = |AB| and B'.y = A.y
#and then take S as midpoint of AB'
S = Point(A.x + d/2, A.y)
#alpha represents the angle of this rotation
alpha = math.atan2(B.y - A.y, B.x - A.x)
#create a circle with center at S passing through A and B'
C = S.buffer(d/2)
#rescale this circle in y-direction so that the corresponding
#axis is R units long
C = scale(C, 1, R/(d/2))
#rotate the ellipse obtained in previous step around A into the
#original position (positive angles represent counter-clockwise rotation)
C = rotate(C, alpha, origin = A, use_radians = True)
for x,y in C.exterior.coords:
print(x, y)
相关问题
- 1. 椭圆几何自定义形状
- 2. 在矩形内创建椭圆/圆形
- 3. 如何在box2d中创建椭圆形状?
- 4. CSS定义形状椭圆
- 5. 如何创建圆角形状的ListView
- 6. 如何创建矩形形状的圆形图像? CSS
- 7. 如何创建圆形UIview而不是矩形形状
- 8. 如何绘制形状像椭圆形,线和手势
- 9. 如何在Javascript中使用Photoshop创建圆形或椭圆形选区?
- 10. Pyqtgraph:如何绘制椭圆或圆形
- 11. 如何绘制一些形状(椭圆形或椭圆形)并计算其面积?
- 12. 如何检查椭圆形是否触及任何其他椭圆形VB
- 13. 如何让形状创建一个圆形?
- 14. 如何用css创建一个椭圆矩形?
- 15. 如何在WPF应用程序中创建椭圆形按钮?
- 16. 如何用VC++使用win32 API创建椭圆形窗口
- 17. 如何创建一个浅椭圆形的CSS3阴影
- 18. 如何创建unity3d向下椭圆形圈的道路?
- 19. 如何在TKInter中创建3个椭圆形的顶部
- 20. InkCanvas表面可以是圆形/椭圆形状吗?
- 21. 如何制作圆形的椭圆形按钮?
- 22. 如何裁剪椭圆形或圆形UIImage?
- 23. 在Java中移动椭圆和椭圆形状?
- 24. 弯曲线形成圆形和椭圆
- 25. CSS div椭圆形
- 26. 向JPanel添加椭圆形状
- 27. 重绘饼图中椭圆形状highcharts
- 28. android椭圆形状对话框
- 29. 如何放置一个椭圆形UITextField
- 30. 如何绘制椭圆形倒挂?