ドキュメント

Unity Engine

Unity Engine

Sqrt(float)

Returns square root of f.
読み終わるまでの所要時間 1 分最終更新 1ヶ月前

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule
public static float Sqrt(float f)

Parameters

Returns

Type

Description

float

Examples

using UnityEngine;using System.Collections;public class ExampleClass : MonoBehaviour{ // The formula made famous by Pythagoras, also used internally by // Vector3.Distance and several other standard functions. float HypotenuseLength(float sideALength, float sideBLength) { return Mathf.Sqrt(sideALength * sideALength + sideBLength * sideBLength); }}