# How can i calculate X Y Z flux density?

**URL:** <https://community.thunkable.com/t/how-can-i-calculate-x-y-z-flux-density/1075044>\
**Category:** Questions about Thunkable X\
**Created:** [January 30, 2021, 1:38am UTC](https://community.thunkable.com/t/how-can-i-calculate-x-y-z-flux-density/1075044 "2021-01-30T01:38:10Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![hoch.academydhj7](https://avatars.discourse-cdn.com/v4/letter/h/6bbea6/32.png) [@hoch.academydhj7](https://community.thunkable.com/u/hoch.academydhj7)\
**Post date:** [January 30, 2021, 1:38am UTC](https://community.thunkable.com/t/how-can-i-calculate-x-y-z-flux-density/1075044/1 "2021-01-30T01:38:10Z")

</div>

Hello, How can I calculate the X Y Z flux density of the magnetometer sensor to  
to get one number (aka absolute field strength)  
I know that it must be in this layout:

```auto
sqrt(X*X+Y*Y+Z*Z)

```

but I cant  
figure out how to calculate it.  
Any help would be great.

---

<div class="post-metadata">

**Author:** ![hoch.academydhj7](https://avatars.discourse-cdn.com/v4/letter/h/6bbea6/32.png) [@hoch.academydhj7](https://community.thunkable.com/u/hoch.academydhj7)\
**Post date:** [January 30, 2021, 2:19am UTC](https://community.thunkable.com/t/how-can-i-calculate-x-y-z-flux-density/1075044/2 "2021-01-30T02:19:24Z")

</div>

@tatiang i thought you replied??? I don’t see your comment

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [January 30, 2021, 2:22am UTC](https://community.thunkable.com/t/how-can-i-calculate-x-y-z-flux-density/1075044/3 "2021-01-30T02:22:26Z")

</div>

No, I just edited your post because when you have an asterix (\*) without spaces around it, the forum software removes the asterix. You can add three back tick marks ``` before and after a line to format it as code and ignore that rule.

Are you trying to figure out where the sqrt function is in Thunkable, or how to get the X, Y and Z values from the mobile device?

---

<div class="post-metadata">

**Author:** ![hoch.academydhj7](https://avatars.discourse-cdn.com/v4/letter/h/6bbea6/32.png) [@hoch.academydhj7](https://community.thunkable.com/u/hoch.academydhj7)\
**Post date:** [January 30, 2021, 2:33am UTC](https://community.thunkable.com/t/how-can-i-calculate-x-y-z-flux-density/1075044/4 "2021-01-30T02:33:15Z")

</div>

I know where it is, but i can’t figure out how to  
use it.

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [January 30, 2021, 2:33am UTC](https://community.thunkable.com/t/how-can-i-calculate-x-y-z-flux-density/1075044/5 "2021-01-30T02:33:35Z")

</div>

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/9/893ca8650678f25f62ed33d426f6567844fd12bf.png)

That’s based on this: [https://docs.thunkable.com/magnetometer](https://docs.thunkable.com/magnetometer).

The “square root” block is the “absolute” block in the Math drawer. You just have to change the value.

You also have to enable the magnetometer before it will work:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/6/86506112afd171ba788179aaa07c995ffdae413b.png)

---

<div class="post-metadata">

**Author:** ![hoch.academydhj7](https://avatars.discourse-cdn.com/v4/letter/h/6bbea6/32.png) [@hoch.academydhj7](https://community.thunkable.com/u/hoch.academydhj7)\
**Post date:** [January 30, 2021, 2:34am UTC](https://community.thunkable.com/t/how-can-i-calculate-x-y-z-flux-density/1075044/7 "2021-01-30T02:34:51Z")

</div>

Sorry i didn’t see your edit 😅

---

<div class="post-metadata">

**Author:** ![hoch.academydhj7](https://avatars.discourse-cdn.com/v4/letter/h/6bbea6/32.png) [@hoch.academydhj7](https://community.thunkable.com/u/hoch.academydhj7)\
**Post date:** [January 30, 2021, 2:38am UTC](https://community.thunkable.com/t/how-can-i-calculate-x-y-z-flux-density/1075044/8 "2021-01-30T02:38:09Z")

</div>

By the way, i don’t see “square root” as you do.  
i see it sqrt(2) in the math section and it doesn’t have a input as your picture

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [January 30, 2021, 2:49am UTC](https://community.thunkable.com/t/how-can-i-calculate-x-y-z-flux-density/1075044/9 "2021-01-30T02:49:23Z")

</div>

Does this help?

 ![Hnet-image (2)](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/8/88207323bd291216e2c69cf92dd29d80c2c85d3a.gif)

Are you using the classic version of Thunkable or the legacy interface or the new drag-and-drop interface?

---

<div class="post-metadata">

**Author:** ![hoch.academydhj7](https://avatars.discourse-cdn.com/v4/letter/h/6bbea6/32.png) [@hoch.academydhj7](https://community.thunkable.com/u/hoch.academydhj7)\
**Post date:** [January 30, 2021, 2:50am UTC](https://community.thunkable.com/t/how-can-i-calculate-x-y-z-flux-density/1075044/10 "2021-01-30T02:50:39Z")

</div>

Oh i now see it!

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [January 30, 2021, 2:52am UTC](https://community.thunkable.com/t/how-can-i-calculate-x-y-z-flux-density/1075044/11 "2021-01-30T02:52:13Z")

</div>

Great! I think you were using the pi (π) block which has an option for sqrt(2). That’s a static value… the square root of 2 is useful in math. But it doesn’t let you take the square root of other values.

---

<div class="post-metadata">

**Author:** ![hoch.academydhj7](https://avatars.discourse-cdn.com/v4/letter/h/6bbea6/32.png) [@hoch.academydhj7](https://community.thunkable.com/u/hoch.academydhj7)\
**Post date:** [January 30, 2021, 2:54am UTC](https://community.thunkable.com/t/how-can-i-calculate-x-y-z-flux-density/1075044/12 "2021-01-30T02:54:41Z")

</div>

One more question how would isolate the number and only get the main number?  
example: just the number 10 and not 10.4597239579757592

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [January 30, 2021, 3:02am UTC](https://community.thunkable.com/t/how-can-i-calculate-x-y-z-flux-density/1075044/13 "2021-01-30T03:02:21Z")

</div>

You can use the **round** block in the Math drawer.

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 1:30pm UTC](https://community.thunkable.com/t/how-can-i-calculate-x-y-z-flux-density/1075044/14 "2024-11-08T13:30:26Z")

</div>

Closed on November 8, 2024, 1:30pm UTC



---

<div class="post-metadata">

**Author:** ![matt\_conroy](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/matt_conroy/32/150843_2.png) [@matt\_conroy](https://community.thunkable.com/u/matt_conroy)\
**Post date:** [December 19, 2024, 5:01pm UTC](https://community.thunkable.com/t/how-can-i-calculate-x-y-z-flux-density/1075044/15 "2024-12-19T17:01:05Z")

</div>

Unlisted on December 19, 2024, 5:01pm UTC


