user3842413
user3842413

Reputation: 176

Matlab - How to align a curve to fit its start and end points to y=0 line?

I have set of points which resembles a curve. I created an additional line from its start to end (dashed line). Please see an example output below;

Set of points

Question: What I would like to do is to realign this curve so that its starting point and the ending point will be on the x axis, where y=0. This means that dashed line will no longer be necessary as the x-axis will play that role.

Upvotes: 0

Views: 136

Answers (1)

HoomanShan
HoomanShan

Reputation: 164

Just Subtract the starting point from all points and apply rotation. the rotation angle is equal to the dashed-line angle.

Upvotes: 1

Related Questions