distance between two points

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
User avatar
Mehran Razzaghi
Posts: 18
Joined: Wed Dec 02, 2015 9:49 am

distance between two points

Post by Mehran Razzaghi » Fri Apr 22, 2022 2:04 am

Hi there,
I want to measure the distance between two points. I tried to do it with Point Kinematic. but there is just one point to define with respect to a body name. how can it implement? For example, if we have a point in the femur and the other one in the tibia, how can we measure the distance changes during a motion?

Thanks.

Tags:

User avatar
Nicos Haralabidis
Posts: 188
Joined: Tue Aug 16, 2016 1:46 am

Re: distance between two points

Post by Nicos Haralabidis » Fri Apr 22, 2022 9:34 am

Hello Mehran,

You can define a point locally in each separate body, then extract those local positions in the global frame for each point (using the point kinematics analysis) and then calculate the distance between these two points using Matlab/Excel etc.

Hope that helps!

Best wishes,

Nicos

User avatar
Mehran Razzaghi
Posts: 18
Joined: Wed Dec 02, 2015 9:49 am

Re: distance between two points

Post by Mehran Razzaghi » Sat Apr 23, 2022 2:15 am

Thanks Nicos for your prompt response.
Ok. so, in the point kinematics analysis, first I should define a point in the femur. then I repeat it for the tibia.
and for the global frame, do you mean I should select global in the 'relative_to_body_name' section, for each point?

And for the point distances, by doing math operations, is the distance between the point calculated according to the global references?

Much appreciated,
Mehran

User avatar
Nicos Haralabidis
Posts: 188
Joined: Tue Aug 16, 2016 1:46 am

Re: distance between two points

Post by Nicos Haralabidis » Sat Apr 23, 2022 9:15 am

Hey Mehran,

In the body name specify the femur for example, in the relative to body tag specify ground. Assuming you define the position of your point p1 in the femur frame, the analysis will output p1 in the ground frame (global). Same processes for point p2 in tibia frame. The points need to be expressed in the same frame for the 'distance' between them to make sense - I believe.

Cheers,

Nicos

User avatar
Mehran Razzaghi
Posts: 18
Joined: Wed Dec 02, 2015 9:49 am

Re: distance between two points

Post by Mehran Razzaghi » Sun Apr 24, 2022 4:10 am

Thanks a lot Nicos for your advice.
It was really helpful. I did it, but there is something which I didn't get it. When I choose Femur as a body and select the ground as a relative to the body, after plotting, the states(0,1,2) didn't change and they are straight lines. is it related to my selected point? what is your idea about this issue?

Many thanks.
Mehran

User avatar
Nicos Haralabidis
Posts: 188
Joined: Tue Aug 16, 2016 1:46 am

Re: distance between two points

Post by Nicos Haralabidis » Sun Apr 24, 2022 8:39 pm

Did you specify a kinematics file? You need to specify this alongside defining the point kinematics analysis. In the first pane of the GUI for the analyze tool it provides a field to set the file.

Cheers,

Nicos

User avatar
Mehran Razzaghi
Posts: 18
Joined: Wed Dec 02, 2015 9:49 am

Re: distance between two points

Post by Mehran Razzaghi » Mon Apr 25, 2022 9:30 am

Yes, I did. I define a '.mot' file in the main setting and defined the point kinematics according to the specified numbers. I attached the file screen of the setting and results. I don't know why there are no changes in the graph? Is it can be because of the proximity of the points to the femur or reference body?

By the way, with this method can I measure the distance between two markers and also ligaments length?

Thanks,
Mehran
Attachments
setting0.jpg
setting0.jpg (290.07 KiB) Viewed 438 times
plot.jpg
plot.jpg (169.11 KiB) Viewed 438 times

User avatar
Nicos Haralabidis
Posts: 188
Joined: Tue Aug 16, 2016 1:46 am

Re: distance between two points

Post by Nicos Haralabidis » Mon Apr 25, 2022 3:30 pm

The .mot file you are using definitely contains coordinates that are changing across time? I also noticed you are trying to perform the analysis from 0-2 seconds, but you have plotted 0-0.7 seconds - perhaps check you are definitely plotting the correct variables. You can measure the distance between markers using this approach, yeah - for ligament lengths you will likely need to model the ligament - perhaps this article can help - https://www.sciencedirect.com/science/a ... 3322000535

Thanks,
Nicos

User avatar
Mehran Razzaghi
Posts: 18
Joined: Wed Dec 02, 2015 9:49 am

Re: distance between two points

Post by Mehran Razzaghi » Tue Apr 26, 2022 12:58 am

Yes, I just made a sample file with some different numbers. I attached the file. Because I just want to follow the femur and tibia, I just digited the 'knee_angle_r'. The time will be synchronized with the setting. I checked it. The question is why when I choose a point in 'body_name' femur there is no change, in the plot, but when I changed to the tibia, there will be a change in the line? (like the pic)
Thank you, this paper will be helpful.

Regards,
Mehran
Attachments
diffrence.jpg
diffrence.jpg (518.32 KiB) Viewed 411 times
sample1.mot
(1.8 KiB) Downloaded 9 times

User avatar
Nicos Haralabidis
Posts: 188
Joined: Tue Aug 16, 2016 1:46 am

Re: distance between two points

Post by Nicos Haralabidis » Tue Apr 26, 2022 8:39 am

Hey Mehran,

I just checked the .mot file you sent, the reason you observe the point on the tibia moving, and not the point on the femur, is because you have only generated motion for the knee flexion-extension coordinate. As the femur is not moving (e.g., flexing, abducting) it is no surprise that the point on that segment remains constant.

Cheers,

Nicos

POST REPLY