Dateien nach "/" hochladen
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
#py -m pip install scipy numpy
|
||||
|
||||
from scipy.integrate import solve_ivp
|
||||
import math
|
||||
import numpy as np
|
||||
from scipy.constants import pi
|
||||
from scipy.interpolate import interp1d
|
||||
from functools import cache
|
||||
import copy
|
||||
from PIL import Image
|
||||
|
||||
|
||||
class Ray():
|
||||
@@ -98,8 +97,18 @@ class Ray():
|
||||
x = self.x
|
||||
y = self.y
|
||||
|
||||
n = None
|
||||
m = None
|
||||
fovX = math.radians(self.fovX)
|
||||
fovY = math.radians(self.fovY)
|
||||
|
||||
angle = math.degrees(math.atan2(math.sqrt(n**2 + m**2)))
|
||||
maxX = math.tan(fovX / 2)
|
||||
maxY = math.tan(fovY / 2)
|
||||
|
||||
resX = self.res
|
||||
resY = self.res * (maxY / maxX)
|
||||
|
||||
n = (x / resX) * maxX
|
||||
m = (y / resY) * maxY
|
||||
|
||||
angle = math.degrees(math.atan(math.sqrt(n**2 + m**2)))
|
||||
print(angle)
|
||||
return self.interpolation(angle)
|
||||
|
||||
Reference in New Issue
Block a user