New block idea: “distance from”

#1

Does anyone else want a “distance from” block? That would be a great addition to the app in the next update!

9 Likes
#2

Well, I think that’s just kind of doing something that you can already do using the Pythagorean Theorem.
Example: Set width/height was a new block that gives you the ability to do something you couldn’t do before. If a Find Distance block gets added, there’s already a way to do that (as mentioned above), which just means no one will really care about it.
These are just my opinions, though. No hard feelings.
Oh, and welcome to the forum! :smiley:

9 Likes
#3

Welcome to the forum, @Ukuleleman24!

5 Likes
#4

Thx man! I didn’t even know that existed!

4 Likes
#5

Welcome to the froum @Ukuleleman24

3 Likes
#6

Given 2 objects “A” & “B” with the x & y positions abbreviated Ax, Ay, Bx, & By

The distance between them is calculated with

√( (Ax-Bx)^2 + (Ay-By)^2 )

That’s from Pythagorean Theorm as was previously mentioned.


Although just because the calculation can be done manually, that doesn’t mean a higher level Hopscotch block is automatically ruled out.

For example, THT recently added When Is Not Pressed. This could be done manually, but they still saw the rule as value added. And, personally, I think they should include a “Point Towards” block even though it can be done with Set Angle and some math.

The fact that you’re asking for a “Distance To” block shows there is at least some need :grinning:

Happy coding & don’t be afraid to ask for new features and/or how to accomplish the same end result as is.

9 Likes
#7

Agreed.

2 Likes
#8

Sounds great! It could be helpful for when you want something to happen at a certain distance.

2 Likes
#9

As @ThinBuffalo said. a^2 + b^2 = c^2, or difference between x&y coords
Also, search before you post. I thought I already saw a topic like this

2 Likes
#10

they’re new, mate. calm down

2 Likes
#11

Oops, that kinda came out rude

Sorry no offense to anyone here

3 Likes
#12

REVIVE!

1 Like
#13

What if a little kid didn’t know the Pythagorean Theorem? They wouldn’t be able to calculate the distance between two objects because they don’t know how to do powers(e.g. 2^2 = 4). (I know the Pythagorean Theorem so it doesn’t really matter)

1 Like
#14

Easy formula for finding distance: |a(Position 1)| - |b(Position 2)| = c(Distance).

1 Like
#15

This one is more refined
|(X1-X2)^2|+|(Y1-Y2)^2|=D (distance)

1 Like
#16

i’m sure they would be smart enough to ask their parents or to look it up.
But the argument still applies.
no more replies someone needs to clive

4 Likes
#17

No need to clive everything, honestly. People could still ask how something works

4 Likes