# VB to C# translation confusion in the morning hours\[solved\]?

**URL:** <https://discourse.mcneel.com/t/vb-to-c-translation-confusion-in-the-morning-hours-solved/152639>\
**Category:** Grasshopper Developer\
**Tags:** windows, math\
**Created:** [December 28, 2022, 11:59pm UTC](https://discourse.mcneel.com/t/vb-to-c-translation-confusion-in-the-morning-hours-solved/152639 "2022-12-28T23:59:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Baris](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/baris/32/772765_2.png) [@Baris](https://discourse.mcneel.com/u/Baris)\
**Post date:** [December 28, 2022, 11:59pm UTC](https://discourse.mcneel.com/t/vb-to-c-translation-confusion-in-the-morning-hours-solved/152639/1 "2022-12-28T23:59:25Z")

</div>

Hi all,  
I found a formula in a C# component which is the following:  
_double alpha1 = 2d \* Math.Atan(Math.Sqrt((2d \* Math.Sqrt(k2 \* -(k1 - k2)) + k1 - 2 \* k2) / k1));_  
Could somebody tell me what 2d is?  
It is not declared, so it is not a custom variable.  
Or maybe it’s just to late…?

Thanks everybody!

---

<div class="post-metadata">

**Author:** ![Tom\_P](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/tom_p/32/766520_2.png) [@Tom\_P](https://discourse.mcneel.com/u/Tom_P)\
**Post date:** [December 29, 2022, 12:14am UTC](https://discourse.mcneel.com/t/vb-to-c-translation-confusion-in-the-morning-hours-solved/152639/2 "2022-12-29T00:14:09Z")

</div>

please post the entire code inside the c# component and / or better a .gh file, that uses the c# component in question.  
it will be quite hard to help without this context.

---

<div class="post-metadata">

**Author:** ![Baris](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/baris/32/772765_2.png) [@Baris](https://discourse.mcneel.com/u/Baris)\
**Post date:** [December 29, 2022, 12:19am UTC](https://discourse.mcneel.com/t/vb-to-c-translation-confusion-in-the-morning-hours-solved/152639/3 "2022-12-29T00:19:45Z")

</div>

I found the error, It came from the automatic translation from vb to c#. It means just 2 times.Sille me.  
That one really hurts…  
Sorry for the unnesarry question and thanks for the answer @Tom_P

---

<div class="post-metadata">

**Author:** ![Tom\_P](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/tom_p/32/766520_2.png) [@Tom\_P](https://discourse.mcneel.com/u/Tom_P)\
**Post date:** [December 29, 2022, 12:38am UTC](https://discourse.mcneel.com/t/vb-to-c-translation-confusion-in-the-morning-hours-solved/152639/4 "2022-12-29T00:38:24Z")

</div>

please mark the topic as solved.  
and maybe change the title to something that is more precise  
maybe  
“automatic translation vb to c# - ??? became 2d”  
so others don t need to dig into the topic - just to see that no more action / help is required.

good night - tom

---

<div class="post-metadata">

**Author:** ![Baris](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/baris/32/772765_2.png) [@Baris](https://discourse.mcneel.com/u/Baris)\
**Post date:** [December 29, 2022, 12:43am UTC](https://discourse.mcneel.com/t/vb-to-c-translation-confusion-in-the-morning-hours-solved/152639/5 "2022-12-29T00:43:46Z")

</div>

The original vb code is:

> alpha1 = (2 \* Math.ATan(Math.Sqrt((2 \* Math.Sqrt(k2 \* ( -(k1 - k2))) + k1 - (2 \* k2)) / k1)))

so \* changed to _d_.
