Creating two points in matlab

  • Thread starter eltrinco
  • Start date
  • #1
8
0

Homework Statement


i had some problem with matlab of how to create two points of random positions and adding another few random points


Homework Equations


how to create the points, set a point as the centre, make the iteration for one point to rotate the centre and also the other iterations for the rest of the points to rotate each other
 

Answers and Replies

  • #2
Simon Bridge
Science Advisor
Homework Helper
17,858
1,654
To set random points use the rand or randn functions.
The other operations are translation and rotations - there are matrixes for those.

i.e. 5 3D points at random would be X=rand(3,5) - each column being the coordinates of a point.
The first data point, for eg, is x1=X(:,1)

For a translation T, just do X=T*X
For a rotation R, just do X=R*X

... look up translation and rotation matrixes to see how to make them.
http://en.wikipedia.org/wiki/Transformation_matrix
http://en.wikipedia.org/wiki/Translation_(geometry [Broken])

Note: matlab has a lot of built infunctions, why not look through the documentation?
 
Last edited by a moderator:

Related Threads on Creating two points in matlab

  • Last Post
Replies
9
Views
3K
Replies
6
Views
7K
Replies
0
Views
1K
  • Last Post
Replies
7
Views
20K
Replies
1
Views
6K
  • Last Post
Replies
6
Views
4K
  • Last Post
Replies
20
Views
4K
Replies
0
Views
2K
Top