初级
验证z=2平面上的变换
未完成
初级参考
完整示例代码供参考,建议自己理解后重新输入
# Same code as above except for the 2 in this line
dino_3d = [(x,y,2) for x,y in dino_vectors]
######################
draw3d(
Points3D(*dino_3d, color='blue'),
*polygon_segments_3d(dino_3d, color='C0')
)
translated = [multiply_matrix_vector(magic_matrix, v) for v in dino_3d]
draw3d(
Points3D(*dino_3d, color='C0'),
*polygon_segments_3d(dino_3d,color='C0'),
Points3D(*translated,color='C3'),
*polygon_segments_3d(translated,color='C3')
)
translated_2d = [(x,y) for (x,y,z) in translated]
draw(
Points(*dino_vectors, color='C0'),
Polygon(*dino_vectors, color='C0'),
Points(*translated_2d, color='C3'),
Polygon(*translated_2d, color='C3'),
save_as='figures/ex_5.26_dino.svg'
)
plt.show()
👑
升级 VIP
解锁全部题目,畅通无阻地学习
- ✓ 解锁全部训练包所有题目
- ✓ 查看完整参考代码和提示
- ✓ 浏览器内直接运行 Python 代码
- ✓ 自动批改 + 进度追踪
30天
¥18
1年
¥99
2年
¥158
3年
¥199