pub struct ZernSag {
pub fringe: bool,
pub norm: f64,
pub coef: Vec<f64>,
pub extrapolate: bool,
pub dx: f64,
pub dy: f64,
/* private fields */
}Expand description
Zernike の多項式(Standard は Noll の順で OpticStudio と同じ正規化、Fringe の順は正規化なし)。
ZernSag::new(fringe, 半径, 係数, 外挿)・term(j, x, y)・max_terms(fringe)
Zernike の矢高の項
serde では内部の groups を書き出さず、読み直したら coef から作り直す。
項の数が ZernSag::max_terms を超えるものは読み直しでエラーにする
Fields§
§fringe: boolFringe の順(規格化なし)か、Standard(Noll の順、規格化)か
norm: f64正規化半径 mm
coef: Vec<f64>項 1, 2, … の係数 mm
extrapolate: bool正規化半径の外でも Zernike の項を使うか
dx: f64Zernike の項の中心の偏心(Zern Decenter X・Y)mm。ρ・φ は (x − dx, y − dy) から
dy: f64Implementations§
Source§impl ZernSag
impl ZernSag
pub fn new( fringe: bool, norm: f64, coef: Vec<f64>, extrapolate: bool, ) -> ZernSag
Sourcepub fn term(&self, j: usize, x: f64, y: f64) -> (f64, f64, f64)
pub fn term(&self, j: usize, x: f64, y: f64) -> (f64, f64, f64)
項 j(1 から)だけの値(係数 1)と (∂/∂x, ∂/∂y)。感度 dz/dA_j に使う
項ひとつの多項式は係数に依らないので、項の数の上限までは一度だけ作って使い回す(光線・パラメータごとに 呼ばれるので、呼ぶたびに作ると確保が重い)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ZernSag
impl<'de> Deserialize<'de> for ZernSag
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ZernSag, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ZernSag, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl JsonSchema for ZernSag
impl JsonSchema for ZernSag
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl Serialize for ZernSag
impl Serialize for ZernSag
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for ZernSag
Auto Trait Implementations§
impl Freeze for ZernSag
impl RefUnwindSafe for ZernSag
impl Send for ZernSag
impl Sync for ZernSag
impl Unpin for ZernSag
impl UnsafeUnpin for ZernSag
impl UnwindSafe for ZernSag
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more