pub struct GridSag {
pub nx: usize,
pub ny: usize,
pub dx: f64,
pub dy: f64,
pub xdec: f64,
pub ydec: f64,
pub z: Vec<[f64; 4]>,
pub nodata: Vec<bool>,
pub linear: bool,
}Expand description
Grid Sag の格子
Fields§
§nx: usize§ny: usize§dx: f64格子の間隔 mm
dy: f64§xdec: f64格子の中心の偏心 mm
ydec: f64§z: Vec<[f64; 4]>点ごとの (z, ∂z/∂x, ∂z/∂y, ∂²z/∂x∂y)。並びは y の小さい行から、行の中は x の小さい点から (iy * nx + ix)。単位は mm
nodata: Vec<bool>値のない点
linear: bool双一次で補間する(false は双三次)。双一次では傾きも格子点の傾きの双一次補間
Implementations§
Source§impl GridSag
impl GridSag
Sourcepub fn mirror_x(&mut self)
pub fn mirror_x(&mut self)
面を x について裏返す(z(x, y) → z(−x, y)): 各行の点の並びを逆にし、∂z/∂x・∂²z/∂x∂y の符号を変える。 中心の偏心 x も符号を変える
Sourcepub fn eval(&self, x: f64, y: f64) -> Option<(f64, f64, f64)>
pub fn eval(&self, x: f64, y: f64) -> Option<(f64, f64, f64)>
格子の値と (∂/∂x, ∂/∂y)。格子の外は 0(OpticStudio と同じ)、値のない点に掛かる升目は None
Sourcepub fn from_dat(text: &str) -> Result<GridSag>
pub fn from_dat(text: &str) -> Result<GridSag>
OpticStudio の .DAT(1 行目 nx ny delx dely unitflag xdec ydec、続いて点ごとに
z dz/dx dz/dy d2z/dxdy nodata。上の行(+y)から、行の中は −x から)を読む。
単位(0 mm・1 cm・2 inch・3 m)は mm に直す
Sourcepub fn fill_derivs(&mut self)
pub fn fill_derivs(&mut self)
微分を矢高の差分で求める(.DAT に微分がないとき。OpticStudio と同じく numpy.gradient の形: 内側は中心差分、端は片側の 1 次差分。∂²z/∂x∂y は ∂z/∂x の y 方向の差分)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for GridSag
impl<'de> Deserialize<'de> for GridSag
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl JsonSchema for GridSag
impl JsonSchema for GridSag
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 moreimpl StructuralPartialEq for GridSag
Auto Trait Implementations§
impl Freeze for GridSag
impl RefUnwindSafe for GridSag
impl Send for GridSag
impl Sync for GridSag
impl Unpin for GridSag
impl UnsafeUnpin for GridSag
impl UnwindSafe for GridSag
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
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