ã¯ããã« 2ç¹éã®è·é¢ãæ±ããæ¹æ³ãããã¤ãããã®ã§ç´¹ä»ãããã¨æãã¾ãï¼ æ¯éãèªå好ã¿ã®æ¹æ³ãæ¢ãã¦ã¿ã¦ä¸ãããã æ¹æ³ç´¹ä» ãã®1ï¼ä¸å¹³æ¹ã®å®ç ä¸å¹³æ¹ã®å®çã®è©³ç´°ã¯è§£èª¬ãµã¤ãã«ãä»»ããã¾ãã ç´è§ä¸è§å½¢ã®æ辺ãC, ãã®ä»ã®è¾ºãAã¨Bã¨ããã¨ã A^2 + B^2 = C^2 ã£ã¦ãªããã¤ã§ããã ã³ã¼ãã¯ãã¡ãã«ãªãã¾ãã Vector2 posA = new Vector2(1f, 2f); Vector2 posB = new Vector2(3f, 4f); float distance = Mathf.Sqrt(Mathf.Pow(posA.x - posB.x, 2) + Mathf.Pow (posA.y - posB.y, 2)); Mathf.Pow()ã¯ç´¯ä¹ãè¡ãé¢æ° Mathf.Sqrt()ã¯ä¸ããæ°ãå¹³æ¹æ ¹ã«ç´ãé¢æ° ãã®2ï¼magnitude magnit
{{#tags}}- {{label}}
{{/tags}}