degrees()
함수, 내장 함수 분류
degrees(rad): radians to degrees, component-wise, with the built-in's exact 180/π; the inverse of radians.
import { degrees } from 'typeshade'
시그니처, 설명, 예제는 커밋 c66579bf의 컴파일러 소스에서 그대로 가져온 영어 원문입니다.
구문
const degrees: <K extends FloatKey>(x: ReadonlyNode<K>) => Node<K>매개변수
xReadonlyNode<K>
반환값
Node<K>
설명
Write it in place of x.mul(RAD2DEG) with a hand-rounded constant.
예제
예제
import { fn, degrees, f32T } from 'typeshade'
const deg = fn('deg', { rad: f32T }, ({ rad }) => degrees(rad))대상별 지원
| 대상 | 지원 | 비고 |
|---|---|---|
| WGSL (WebGPU) | 지원 |
|
| GLSL ES 3.00 (WebGL2) | 지원 |
|
| CPU 오라클 | 지원 | Evaluated in f64 by the oracle. |
관련 가이드
함께 보기
소스
src/core/ir/node.ts, 1516행, 커밋 c66579bf 기준