User Tools

Site Tools

한국어

cubloc:sqr:index

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
cubloc:sqr:index [2026/02/20 05:11] admincubloc:sqr:index [2026/02/20 15:37] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ====== Sqr ====== ====== Sqr ======
  
-The Sqr function returns the square root of a numeric value.  +The **Sqr** function returns the square root ($\sqrt{x}$) of numeric value. It is essential for distance calculations, sensor data normalizationand power computations.
-The square root of a number $x$ is a value $y$ such that $y^2 = x$This is a basic yet essential mathematical operation used in various fields, including distance calculations (Pythagorean theorem)signal processingroot-mean-square (RMS) power calculations, and physics-based motion simulations.+
  
- +For the best precision, use the ''Single'' data type. **Note:** Input must be a **non-negative** numbernegative values will cause a runtime error.
- +
-[Image of square root function graph] +
- +
- +
-On the Cubloc platform, the Sqr function is optimized for efficiency. To maintain the highest degree of precision, especially when the input is not a perfect square, it is highly recommended to use the ''Single'' data type for both the input value and the result. +
- +
-Sqr accepts any non-negative real number. Attempting to calculate the square root of a negative number may result in a runtime error or an undefined result, as the system does not support imaginary numbers.+
  
 Example Example
Line 22: Line 14:
  
 ==== Explanation: ==== ==== Explanation: ====
 +  * **B**: A non-negative number.
 +  * **Sqr B**: Calculates the square root.
 +  * **A**: Stores the result.
  
-  * **B** should contain a non-negative numeric value. +**Usage Tip (Distance):** 
-  * **Sqr B** calculates the principal square root of that value. +To find the distance between two points $(x1, y1)$ and $(x2, y2)$:
-  * The resulting value—commonly used in calculating the magnitude of vectors or normalizing sensor data—is stored in **A**. +
- +
- +
- +
-[Image of Pythagorean theorem formula] +
- +
- +
-**Usage Tip:** When calculating the distance between two points $(x1, y1)$ and $(x2, y2)$, the Sqr function is used in conjunction with the Pythagorean theorem+
 ''Distance = Sqr((x2-x1)^2 + (y2-y1)^2)'' ''Distance = Sqr((x2-x1)^2 + (y2-y1)^2)''
  
 [[cubloc:index#system_library:|Go CUBLOC home]] [[cubloc:index#system_library:|Go CUBLOC home]]
cubloc/sqr/index.1771564267.txt.gz · Last modified: by admin