# Using maths not dynamo functions in Python blocks

**URL:** <https://forum.dynamobim.com/t/using-maths-not-dynamo-functions-in-python-blocks/78126>\
**Category:** Developers\
**Created:** [June 28, 2022, 3:22pm UTC](https://forum.dynamobim.com/t/using-maths-not-dynamo-functions-in-python-blocks/78126 "2022-06-28T15:22:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alien](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alien/32/40701_2.png) [@Alien](https://forum.dynamobim.com/u/Alien)\
**Post date:** [June 28, 2022, 3:22pm UTC](https://forum.dynamobim.com/t/using-maths-not-dynamo-functions-in-python-blocks/78126/1 "2022-06-28T15:22:15Z")

</div>

Maths is meant to be faster… So i’m trying to do more maths 😃

However, I can’t work out what I’ve done wrong here

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/f/6f96110d653777b43c8969762a2fa7746e8070a0.png)

Black solid angled line is the path (taken from Revit)

Code on left is blue dots.  
centrepts = horizontal dotted blue  
perimeterpts = curvy dotted blue  
Code on left is correct for horizontal path (centre point of a ‘wheel’ and perimeter point going round and round.)

Code on right  
centrepts = dotted black lines (this seems correct)  
perimeterpoints = red dotted lines… ARRGH. Clearly wrong. This is the latest attempt

Bit of explanation for issues with the 2nd bit of code…  
**Line 25** - I’m trying to find the angle of the line at _any_ point. So I could use a spline for example. But this gives me a varying angle with a straight line! So this is obviously wrong. If I run this line instead of line 27 the red dots go into a circle.

**lines 33 and 34** - well I think this should rotate my curved perimeter point path. But clearly it’s not right.  
Can’t seem to work out why!

What am I missing? 😕

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/e/2/e2e7e53c858e021e41dff2959d96d2513a47ca90.png)

---

<div class="post-metadata">

**Author:** ![Alien](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alien/32/40701_2.png) [@Alien](https://forum.dynamobim.com/u/Alien)\
**Post date:** [June 28, 2022, 10:21pm UTC](https://forum.dynamobim.com/t/using-maths-not-dynamo-functions-in-python-blocks/78126/2 "2022-06-28T22:21:00Z")

</div>

![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/4/5/45b61bfa6fb7fcc3fa678b06c6203984aacef9d4.png)

TIL it needed to be in radians…  
However that’s manually added on line 29 …  
The formulae on line 25-28 doesn’t work as expected 😕
