# \[Snippet\] Blueprint Node: Math nodes

**URL:** <https://forums.unrealengine.com/t/snippet-blueprint-node-math-nodes/1966>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [April 6, 2014, 6:17am UTC](https://forums.unrealengine.com/t/snippet-blueprint-node-math-nodes/1966 "2014-04-06T06:17:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_c28f5816](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_c28f5816](https://forums.unrealengine.com/u/anonymous_user_c28f5816)\
**Post date:** [April 6, 2014, 6:17am UTC](https://forums.unrealengine.com/t/snippet-blueprint-node-math-nodes/1966/1 "2014-04-06T06:17:20Z")

</div>

I’ve created a new snippet for the community for a blueprint math class that exposes a couple of C++ Math functions to blueprints:

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — https://unrealcommunity.wiki/! You will be able to find content from...

VRandCone - Returns a random vector cone based on variables passed to it - handles both uniform and non-uniform (“squashed”) cones

DegreesToRadians - Converts degrees to radians  
RadiansToDegrees - Converts radians to degrees  
IsNearlyEqual - Does float X nearly equal float Y ± W  
IsNearlyZero - Does float X nearly equal zero ± W  
IsPowerOfTwo - Is float X a power of two

I detail the use of these nodes in the snippet and also cover the use of IsNearlyEqual in eliminating Machine Epsilon (and explain what it is in the first place).

I’ve posted the full source so that non-programmers should be able to make use of this - If you have any issues feel free to comment here and I’ll help you best I can 😃

---

<div class="post-metadata">

**Author:** ![mathnode](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mathnode](https://forums.unrealengine.com/u/mathnode)\
**Post date:** [April 6, 2014, 12:13pm UTC](https://forums.unrealengine.com/t/snippet-blueprint-node-math-nodes/1966/2 "2014-04-06T12:13:19Z")

</div>

I really like this, thanks.
