Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • CreatiCode
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

CreatiCode Scratch Forum

  1. CreatiCode Forum
  2. 知识库
  3. 二维积木
  4. 计算两点之间距离的运算积木

计算两点之间距离的运算积木

Scheduled Pinned Locked Moved 二维积木
1 Posts 1 Posters 777 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    creaticodeteacher2-mail
    wrote on last edited by admin
    #1

     

    先修科目

    • 组装积木

     

    什么是“直线距离”?什么是“曼哈顿距离”?

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/9cfb1ba7-631f-40f0-8ae9-c181e07d7a13.png" width="700" style="">

    假如你在上方地图的起点,你想走到终点。如果你沿直线行走,路线的长度就是这两点的直线距离。在地图上用黄线来表示。

    不过,在很多情况下你无法走直线。比如说,街区之间有房屋和建筑物,就像曼哈顿市一样。在这种情况下,你必须沿着横向街道和纵向街道行走。这些线的总长度就是这两点的“曼哈顿距离”。

    起点与终点之间的直线距离和曼哈顿距离,下方还有几个例子:
     
    示例1:
    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/e75f5035-cbcb-4b0c-9615-f4f80125daad.png" width="700" style="">
     

    示例2:
    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/53d43656-c5d5-4a0d-8740-0742b616ed89.png" width="700" style="">
     
    示例3:
    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/a569df42-68a1-4709-840f-4caef8147cf9.png" width="700" style="">
     
     

    积木

    积木“计算距离x( ) y( ) 到 x( ) y( ) 方法(直线距离/曼哈顿距离)”是运算类别的报表积木。

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/5fcb59dc-c022-4024-a026-f524f2fe3499.png" width="850" style="">
     

    这个积木怎么用?

    这个积木会显示两个指定点的距离。

    在创益编程中,“点”、“角色的位置”都是用x坐标、y坐标来定义的。
    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/51a9d9b3-9ebf-4311-a5b5-7fe4879cd77a.png" width="600" style="">

     
    需要在积木中输入两个点的坐标值,并点击下拉菜单选择“直线距离”或“曼哈顿距离”。
    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/dde55fbb-0948-401a-bef8-4f08e570055f.png" width="600" style="">

    用法如下:

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/15d54b9b-0a02-4d2a-bbe1-149fc82c133e.gif" width="700" style="border-radius: 5px; border: 1px solid #29622d;">
     

    1 Reply Last reply
    0

    Hello! It looks like you're interested in this conversation, but you don't have an account yet.

    Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

    With your input, this post could be even better 💗

    Register Login
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • CreatiCode