Category:2003 software
Category:Windows multimedia software
Category:Digital video software
Category:Windows-only software
Category:Video editing software
Category:Discontinued softwareQ:
How to convert (x, y, z) from a point object to (x, y, z, z-coord) in cartesian coordinates?
I have a 3D point object with the coordinates (x, y, z)
I need the result to be like this:
(x, y, z, z-coord)
I found this, but it's not working.
Edit:
I need this as I need to have the same x/y/z values, but with a negative z value
I am using matplotlib for this, so hopefully this helps someone else too.
A:
x, y, z are the x, y, z components of the 4D vector (x, y, z, 1). Then use some math to transform the coordinates into the more familiar Cartesian coordinates. Here is an example using python and numpy.
import numpy as np
from numpy import *
x = np.array([1,2,3,4])
y = np.array([1,2,3,4])
z = np.array([1,2,3,4])
# Convert to 4D
x, y, z, 1 = x.reshape(-1, 1, 1, 1)
# Translate to common coordinates
# -h_0, h_0, 0, 0 = (x, y, z, 1)
h_0 = (-1, 1, 0, 0)
h = h_0.transpose()
# Calculate new coordinates
x = x[0]*h[0] + x[1]*h[1] + x[2]*h[2] + x[3]*h[3]
y = y[0]*h[0] + y[1]*h[1] + y[2]*h[2] + y[3]*h[3]
z = z[0]*h[0] + z[1]*h[1] + z[2]*h[2] + z[3]*h[3]
# Print results ac619d1d87
Related links:
Comments