# Draw specific lines and measure ange between them

**URL:** <https://discourse.slicer.org/t/draw-specific-lines-and-measure-ange-between-them/7411>\
**Category:** Support\
**Created:** [July 4, 2019, 12:44pm UTC](https://discourse.slicer.org/t/draw-specific-lines-and-measure-ange-between-them/7411 "2019-07-04T12:44:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bence\_Horvath](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/bence_horvath/32/4029_2.png) [@Bence\_Horvath](https://discourse.slicer.org/u/Bence_Horvath)\
**Post date:** [July 4, 2019, 12:44pm UTC](https://discourse.slicer.org/t/draw-specific-lines-and-measure-ange-between-them/7411/1 "2019-07-04T12:44:33Z")

</div>

Hi,

I would like to know, is it possible, that I draw line or circle with specific lenght/radius (instead of I move the mosue and change the lenght), like type xx mm and I get a xx mm lenght line or circle.  
And how can I measure angle between this lines?

Thanks!  
Bence

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [July 4, 2019, 12:52pm UTC](https://discourse.slicer.org/t/draw-specific-lines-and-measure-ange-between-them/7411/2 "2019-07-04T12:52:48Z")

</div>

You can create sphere or line using VTK source objects (vtkSphereSource, vtkLineSource, etc.) and set their output in a model node as input. See for example [here](https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Manipulating_objects_in_the_slice_viewer) and in [PerkLab Slicer programming tutorial](https://www.slicer.org/wiki/Documentation/Nightly/Training#PerkLab.27s_Slicer_bootcamp_training_materials).

You can compute angles using trigonometry functions (e.g., [arctan2](https://docs.scipy.org/doc/numpy/reference/generated/numpy.arctan2.html) between line direction vectors). See a complete example [here](https://gist.github.com/lassoan/9bf334743871e400f7e3b3745b312b14).

---

<div class="post-metadata">

**Author:** ![Bence\_Horvath](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/bence_horvath/32/4029_2.png) [@Bence\_Horvath](https://discourse.slicer.org/u/Bence_Horvath)\
**Post date:** [July 4, 2019, 1:30pm UTC](https://discourse.slicer.org/t/draw-specific-lines-and-measure-ange-between-them/7411/3 "2019-07-04T13:30:31Z")

</div>

Thank you very much!
