-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcode.py
More file actions
38 lines (26 loc) · 883 Bytes
/
code.py
File metadata and controls
38 lines (26 loc) · 883 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# -*- coding: utf-8 -*-
"""Untitled0.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1iTL6MayQWD-2ih_Zbov6ppNQt-tDmMOV
"""
import numpy as np
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.set_xlim(-5,6)
ax.set_ylim(-6,5)
ax.set_zlim(-12,6)
ax.set_xlabel('x-axis')
ax.set_ylabel('y-axis')
ax.set_zlabel('z-axis')
# plot vector a = [-1 -5 -10] and b = [2 -1 2]
#ax.plot3D([-2], [-1], [2], marker='o', label='(2, -1, 2)')
ax.plot3D([-1], [-5], [-10], marker='o', label='P = (-1, -5, -10)')
ax.text(-1, -5, -10,'P')
# equation given line
ax.plot3D([5, 2],[3, -1],[4, 2], label = 'line (1.0.1)')
# equation line parallel to given line
ax.plot3D([5, -1], [3,-5], [4, -10], label='line (3.0.6)')
plt.legend()
plt.show()