You are on page 1of 3

Faisal Fadilah

20/460296/TK/50885

TUGAS METODE NUMERIK

Hitung persamaan bidang dan tentukan strike dan dip dari 3 titik-titik berikut ini ( sertakan algoritma
dan script programnya )

A = [56, 324, 296]

B = [286, 386, 176]

C = [114, 428, 225]

import matplotlib.pyplot as plt

Misalkan titik A, B, C menjadi X, Y, Z


# Plot titik koordinat X, Y, Z
X = [56, 324, 296]
Y = [286, 386, 176]
Z = [114, 428, 225]

# Nilai titik A, B, C
ax, ay, az = (X[0], Y[0], Z[0])
bx, by, bz = (X[1], Y[1], Z[1])
cx, cy, cz = (X[2], Y[2], Z[2])

import numpy as np
# Hitung koefisien masing-masing variable dalam persamaan px+qy+rz+s = 0
p = np.linalg.det(
    [[ay, az, 1],
     [by, bz, 1],
     [cy, cz, 1]])

q = -np.linalg.det(
    [[ax, az, 1],
     [bx, bz, 1],
     [cx, cz, 1]])

r = np.linalg.det(
    [[ax, ay, 1],
     [bx, by, 1],
     [cx, cy, 1]])

s = -np.linalg.det(
    [[ax,ay,az],
     [bx,by,bz],
     [cx,cy,cz]])

'''print('p = ', p, 'q = ', q, 'r = ', r, 's = ', s)'''

# Tentukan nilai mx dan my


z0 = -s/r
mx = -p/r
my = -q/r

'''print('mx = ', mx,'my = ', my)'''

# Tentukan arah dip menggunakan nilai mx dan my


if (mx < 0) and (my > 0) :
    print('Arah dip South East')
elif (mx < 0) and (my < 0) :
    print('Arah dip North East')
elif (mx > 0) and (my > 0) :
    print('Arah dip South West')
elif (mx > 0) and (my < 0) :
    print('Arah dip North West')
elif (mx > 0) and (my == 0) :
    print('Arah dip West')
elif (mx == 0) and (my < 0) :
    print('Arah dip North')
elif (mx == 0) and (my > 0) :
    print('Arah dip South')
elif (mx < 0) and (my == 0) :
    print('Arah dip East')
else :
    print('Error')

import math
# Menghitung Nilai strike
strike = math.atan(-q/p)

# Nilai dip
dip = math.atan(((p**2+q**2)/r**2)**0.5)

# Mengubah Strike dan Dip dari radian ke Degree


deg_strike = (strike*180/math.pi)
deg_dip = (dip*180/math.pi)

if (strike < 0) :
  print('Strike = ', (360 + deg_strike))
else :
  print('Strike = ', deg_strike)

print('dip = ', deg_dip)

# Proses visualisasi data


print('Visualization')
x = np.linspace(56, 286, 10)
y = np.linspace(324, 428, 10)
A, B = np.meshgrid(x, y)
C = (-s - p*A - q*B) / r
 
fig = plt.figure()
ax = fig.gca(projection='3d')
ax.set_xlabel("Easting")
ax.set_ylabel("Northing")
ax.set_zlabel("Elevation")
surf = ax.plot_surface(A, B, C)
 
plt.show()

Arah dip South West

Strike = 315.0175807848159

dip = 50.34713762871944

You might also like