How can i calculate X Y Z flux density?

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:

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

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

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

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?

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

That’s based on this: 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:

2 Likes

Sorry i didn’t see your edit :sweat_smile:

1 Like

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

Does this help?

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

1 Like

Oh i now see it!

2 Likes

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.

1 Like

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

You can use the round block in the Math drawer.

1 Like