# how to compute average vertical (y-axis) distance between two curves in 3d space?

**URL:** <https://discourse.slicer.org/t/how-to-compute-average-vertical-y-axis-distance-between-two-curves-in-3d-space/43649>\
**Category:** Support\
**Created:** [July 8, 2025, 12:46pm UTC](https://discourse.slicer.org/t/how-to-compute-average-vertical-y-axis-distance-between-two-curves-in-3d-space/43649 "2025-07-08T12:46:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![LJW](https://avatars.discourse-cdn.com/v4/letter/l/51bf81/32.png) [@LJW](https://discourse.slicer.org/u/LJW)\
**Post date:** [July 8, 2025, 12:46pm UTC](https://discourse.slicer.org/t/how-to-compute-average-vertical-y-axis-distance-between-two-curves-in-3d-space/43649/1 "2025-07-08T12:46:03Z")

</div>

hi,

i’m trying to find the average vertical distance (along the y-axis) between two curves in 3d space.

basically, i want to measure how far apart the two curves are in the y-direction — not the full 3d distance, just the offset along the y-axis. the curves are already defined, and i’d like to compute this average y-difference between them.

is there a good way to do this, either in 3d slicer or with python/numpy?

thanks a lot! any ideas would be appreciated.

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [July 8, 2025, 9:39pm UTC](https://discourse.slicer.org/t/how-to-compute-average-vertical-y-axis-distance-between-two-curves-in-3d-space/43649/2 "2025-07-08T21:39:01Z")

</div>

Yes, you can do this in python. Just get the points from the two curves and subtract and look at the y (axis). If you need more detail you can resample in the markups module.

```auto
>>> n = getNode("OC")
>>> arrayFromMarkupsControlPoints(n)
array([[-102.88747763, -36.66582196, 87.48674899],
       [-32.85996019, -42.21678371, 87.48674899],
       [-32.85996019, -117.36826585, 87.48674899],
       [-114.84339524, -175.86686273, 87.48674899]])
>>> 

```
