Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Consider the following set of points in the 4D space:

points = {{Log[5], Log[2], Log[8/5], Log[23/16]}, {Log[5], Log[2], Log[23/17], 
  Log[17/10]}, {Log[5], Log[16/11], Log[11/5], Log[23/16]}, {Log[5], 
  Log[17/12], Log[23/17], Log[12/5]}, {Log[5], Log[23/18], Log[11/5], 
  Log[18/11]}, {Log[5], Log[23/18], Log[3/2], Log[12/5]}, {Log[5/3], 
  Log[6], Log[8/5], Log[23/16]}, {Log[5/3], Log[6], Log[23/17], 
  Log[17/10]}, {Log[11/7], Log[16/11], Log[7], Log[23/16]}, {Log[3/2],
  Log[17/12], Log[23/17], Log[8]}, {Log[11/7], Log[23/18], Log[7], 
  Log[18/11]}, {Log[3/2], Log[23/18], Log[3/2], Log[8]}, {Log[4/3], 
  Log[6], Log[2], Log[23/16]}, {Log[17/13], Log[6], Log[23/17], 
  Log[13/6]}, {Log[4/3], Log[12/7], Log[7], Log[23/16]}, {Log[17/13], 
  Log[13/8], Log[23/17], Log[8]}, {Log[9/7], Log[23/18], Log[7], 
  Log[2]}, {Log[9/7], Log[23/18], Log[7/4], Log[8]}, {Log[23/19], 
  Log[6], Log[2], Log[19/12]}, {Log[23/19], Log[6], Log[19/13], 
  Log[13/6]}, {Log[23/19], Log[12/7], Log[7], 
  Log[19/12]}, {Log[23/19], Log[13/8], Log[19/13], 
  Log[8]}, {Log[23/19], Log[19/14], Log[7], Log[2]}, {Log[23/19], 
  Log[19/14], Log[7/4], Log[8]}}

All the points lie on a 3D hyperplane since MatrixRank[# - points[[1]] & /@ points] returns 3. How can I show the points in a 3D space (e.g., using Graphics3D) so that the distance of points are kept intact?

share|improve this question
    
ListPointPlot3D? –  Jonathan Shock May 24 '13 at 0:23
    
You should project the points into 3d first. –  Helium May 24 '13 at 0:25
1  
When you say that you want the distance of the points to be left intact, do you mean the distance as measured on the hypersurface, or that in the 4d space. You can look at points on a sphere and their 2d and 3d distance will be very different. –  Jonathan Shock May 24 '13 at 0:32
    
I mean "the distance as measured on the hypersurface". –  Helium May 24 '13 at 0:59

1 Answer 1

up vote 5 down vote accepted

Update

I got a MatrixRank of 4 with the original approximate data, but with the updated exact data, the rank is 3.

The basic idea is that Orthogonalize will return an orthonormal basis for the subspace spanned by the vectors, along with some zero vectors interspersed. (Orthonormal means unit length vectors that are pairwise perpendicular.) Deleting the zero vectors leaves the basis in the form of a matrix -- in other words, they form a 3D coordinate system in the hyperplane with the origin at the first point. Multiplying the 4D vectors by the matrix yields the 3D coordinates of the subspace.

With the exact coordinates

The following shows the result:

Graphics3D[{PointSize[Large], Darker@Red,
  Point[
   With[{vectors = # - First@points & /@ points}, 
    N @ DeleteCases[Orthogonalize[vectors], {0, 0, 0, 0}].Transpose[
       vectors] // Transpose]
   ]
  }]

Projected points

With the approximate coordinates

Replace the {0, 0, 0, 0} with {0., 0., 0., 0} in DeleteCases. For example,

With[{vectors = # - First@points & /@ N@points}, 
 DeleteCases[Orthogonalize[vectors], {0., 0., 0., 0.}].Transpose[vectors] // Transpose]

The original question had numbers with only six digits of accuracy. In that case one needed

Orthogonalize[vectors, Tolerance -> 10^-5]

and the results were correspondingly accurate (5 decimal places).

share|improve this answer
    
Thanks Michael for your rapid answer. I know pretty much nothing about linear algebra. I get 4 for MatrixRank[points]but 3 for MatrixRank[# - First@points & /@ points]. What does it mean? Doesn't it imply that they lie on a 3D hyperplane? –  Helium May 24 '13 at 0:54
    
Your result implies that the points lie on a 3D hyperplane, but my result of 4 for MatrixRank[# - First@points & /@ points] implies they do not. Is there an error in the points posted in the question? –  Michael E2 May 24 '13 at 1:00
    
Rounding errors, I guess. I get the same result as yours when I copy the points from the webpage. Could you please explain a bit about the mathematical details of how your code works. –  Helium May 24 '13 at 1:10
    
I updated the point set. It should be ok now. –  Helium May 24 '13 at 1:11
    
@Mohsen Yes, the points are ok now. I added some details. I wasn't sure how much additional explanation you needed. –  Michael E2 May 24 '13 at 2:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.