Dateien nach "/" hochladen
This commit is contained in:
@@ -1,11 +1,10 @@
|
|||||||
|
#py -m pip install scipy numpy
|
||||||
|
|
||||||
from scipy.integrate import solve_ivp
|
from scipy.integrate import solve_ivp
|
||||||
import math
|
import math
|
||||||
import numpy as np
|
import numpy as np
|
||||||
from scipy.constants import pi
|
from scipy.constants import pi
|
||||||
from scipy.interpolate import interp1d
|
from scipy.interpolate import interp1d
|
||||||
from functools import cache
|
|
||||||
import copy
|
|
||||||
from PIL import Image
|
|
||||||
|
|
||||||
|
|
||||||
class Ray():
|
class Ray():
|
||||||
@@ -98,8 +97,18 @@ class Ray():
|
|||||||
x = self.x
|
x = self.x
|
||||||
y = self.y
|
y = self.y
|
||||||
|
|
||||||
n = None
|
fovX = math.radians(self.fovX)
|
||||||
m = None
|
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)
|
return self.interpolation(angle)
|
||||||
|
|||||||
Reference in New Issue
Block a user