Pass two points to get the vector from them in the form (x, y, z). >>> create_vector((0, 0, 0), (1, 1, 1)) (1, 1, 1) >>> create_vector((45, 70, 24), (47, 32, 1)) (2, -38, -23) >>> create_vector((-14, -1, -8), (-7, 6, 4)) (7, 7, 12)
(end_point1: Point3d, end_point2: Point3d)
| 33 | |
| 34 | |
| 35 | def create_vector(end_point1: Point3d, end_point2: Point3d) -> Vector3d: |
| 36 | """ |
| 37 | Pass two points to get the vector from them in the form (x, y, z). |
| 38 | |
| 39 | >>> create_vector((0, 0, 0), (1, 1, 1)) |
| 40 | (1, 1, 1) |
| 41 | >>> create_vector((45, 70, 24), (47, 32, 1)) |
| 42 | (2, -38, -23) |
| 43 | >>> create_vector((-14, -1, -8), (-7, 6, 4)) |
| 44 | (7, 7, 12) |
| 45 | """ |
| 46 | x = end_point2[0] - end_point1[0] |
| 47 | y = end_point2[1] - end_point1[1] |
| 48 | z = end_point2[2] - end_point1[2] |
| 49 | return (x, y, z) |
| 50 | |
| 51 | |
| 52 | def get_3d_vectors_cross(ab: Vector3d, ac: Vector3d) -> Vector3d: |