acos
이 페이지에서

acos()

함수, 내장 함수 분류

acos(x): arccosine of x, returning radians in [0, π], component-wise.

import { acos } from 'typeshade'

시그니처, 설명, 예제는 커밋 c66579bf의 컴파일러 소스에서 그대로 가져온 영어 원문입니다.

구문

const acos: <K extends FloatKey>(x: ReadonlyNode<K>) => Node<K>

매개변수

x ReadonlyNode<K>

반환값

Node<K>

설명

Like asin it is undefined outside x ∈ [-1, 1], so clamp the argument first when float error can push it a hair past ±1, as it can after a chain of floating-point operations.

예제

예제

import { fn, acos, clamp, f32T } from 'typeshade'
const angle = fn('angle', { cosTheta: f32T }, ({ cosTheta }) => acos(clamp(cosTheta, -1, 1)))

대상별 지원

대상지원비고
WGSL (WebGPU) 지원

acos(x).

GLSL ES 3.00 (WebGL2) 지원

acos(x).

CPU 오라클 지원

Evaluated in f64 by the oracle.

함께 보기

소스

src/core/ir/node.ts, 1377행, 커밋 c66579bf 기준

이 페이지 편집 문제 보고