gradoptics.optics.vector
- gradoptics.optics.vector.batch_vector(x, y, z)
Returns a batch of vector
- Parameters
x – Component of the vectors along the x axis (
torch.tensor
)y – Component of the vectors along the y axis (
torch.tensor
)z – Component of the vectors along the z axis (
torch.tensor
)
- Returns
A batch of 3d vectors (
torch.tensor
)
- gradoptics.optics.vector.normalize_batch_vector(input_vector, eps=1e-15)
Normalize the
input_vector
using the Euclidian norm- Parameters
input_vector – A batch of 3d vectors (
torch.tensor
)eps – Parameter used for numerical stability. Default is
'1e-15'
- gradoptics.optics.vector.dot_product(batch_vector1, batch_vector2)
Computes the dot product between the given batch of 3d vectors
- Parameters
batch_vector1 – A batch of 3d vectors (
torch.tensor
)batch_vector2 – A batch of 3d vectors (
torch.tensor
)
- Returns
The dot product between
batch_vector1
andbatch_vector2
(torch.tensor
)
- gradoptics.optics.vector.cos_theta(batch_vector1, batch_vector2, eps=1e-15)
Computes the cosine between the given batch of 3d vectors
- Parameters
batch_vector1 – A batch of 3d vectors (
torch.tensor
)batch_vector2 – A batch of 3d vectors (
torch.tensor
)eps – Parameter used for numerical stability. Default is
'1e-15'
- Returns
The cosine between
batch_vector1
andbatch_vector2
(torch.tensor
)
- gradoptics.optics.vector.cross_product(vector1, vector2)
Computes the cross product between the given 3d vectors
- Parameters
vector1 – A 3d vector (
torch.tensor
)vector2 – A 3d vector (
torch.tensor
)
- Returns
The cross product between
vector1
andvector2
(torch.tensor
)
- gradoptics.optics.vector.vector3d(x, y, z)
Returns a 3d vector
- Parameters
x – Component of the vector along the x axis (
torch.tensor
)y – Component of the vector along the y axis (
torch.tensor
)z – Component of the vector along the z axis (
torch.tensor
)
- Returns
A 3d vector (
torch.tensor
)
- gradoptics.optics.vector.normalize_vector(input_vector, eps=1e-15)
Normalize the
input_vector
using the Euclidian norm- Parameters
input_vector – A 3d vector (
torch.tensor
)eps – Parameter used for numerical stability. Default is
'1e-15'
- gradoptics.optics.vector.get_perpendicular_vector(input_vector, eps=1e-15)
Returns a vector perpendicular to
input_vector
- Parameters
input_vector – A 3d vector (
torch.tensor
)eps – Parameter used for numerical stability. Default is
'1e-15'