座標変換演算子

CurrentTransformation Graphics State Variable. The type Transformation and the coefficients associated with Transformations are defined in . ]]> この節では,座標変換を操作する演算子,及びCurrentTransformation 作図状態変数に影響を与える演算子を定義する。 座標変換型及び座標変換に関連した係数は, で定義する。

T1 and T2 are two Transformations, the mapping which consists of applying the mapping represented by T1 to the result of the mapping represented by T2 is also of the form specified in . The Transformation which represents this mapping is referred to as the concatenation of T1 with T2 (denoted T1 × T2). ]]> 座標変換を行う演算子群を定義するためには,次の定義が必要となる。 T1及びT2が二つの座標変換である場合,T2が表す対応付けの結果に対して, さらにT1が表す対応付けを適用した対応付けも,で定める形式をとる。 この対応付けを表現する座標変換を,T1T2との結合と呼ぶ (T1 × T2と表記する。)。 T1 and T2 are two Transformations whose associated matrices are respectively ]]> T1及びT2は,それぞれ次に示す行列表現に対応する座標変換とする。 M1= a1 c1 e1 b1 d1 f1 001 M2= a2 c2 e2 b2 d2 f2 001

T1 × T2 is the Transformation whose associated matrix is the (usual matrix) product M1 × M2, which is defined by ]]> このとき,T1 × T2もまた座標変換であり,その行列表現は, 次に示す(通常の意味での行列の)積M1 × M2となる。 M1 × M2= (a1× a2+ b1× c2) (c1× a2+ d1× c2) (e1× a2+f1× c2+ e2) (a1× b2+ b1× d2) (c1× b2+ d1× d2) (e1× b2+f1× d2+ f2) 001

. In addition to these operator-specific exceptions, there are generic exceptions which may be raised during the interpretation of almost any operator. These generic exceptions and their semantics are described in . ]]> これらの演算子及びその動作の仕様は,演算子を解釈した結果として内容例外を 引き起こす条件に関する仕様をも含む。 内容例外及び例外処理は,で定義する。 これら演算子固有の例外に加えて,ほとんどすべての演算子を解釈する際にも 発生しうる共通的な例外が存在する。 それらの共通例外及びその意味は,で記述する。

ScaleT

ScaleT operator takes two operands ]]> ScaleT演算子は,次に示す2個のオペランドをとる。

  • <s2: Number>
  • <s1: Number> ]]>
  • <s2: 数>
  • <s1: 数>

    そして,次に示す1個の結果を返す。

  • <T: Transformation> ]]>
  • <T: 座標変換>

    ここで,Tは,次に示す行列表現に対応する座標変換とする。 s1 00 0s10 001 s1 in the x-axis and s2 in the y-axis. ]]> この座標変換を適用すると,その作用として,ユーザ座標系は,x軸方向にs1, y軸方向にs2の倍率で拡大/縮小される。

    Scale

    Scale operator takes two operands ]]> Scale演算子は,次に示す2個のオペランドをとる。

  • <s2: Number>
  • <s1: Number> ]]>
  • <s2: 数>
  • <s1: 数>

    Scale operator is the same as ]]> 結果は,返さない。 Scale演算子の作用は,次の処理を行った場合と同一とする。

  • { s1 s2 ScaleT Concat }

    TranslateT

    TranslateT operator takes two operands ]]> TranslateT演算子は,次に示す2個のオペランドをとる。

  • <y: Number>
  • <x: Number> ]]>
  • <y: 数>
  • <x: 数>

    そして,1個の結果を返す。

  • <T: Transformation> ]]>
  • <T: 座標変換>

    ここで,Tは座標変換で,その行列表現は,次のとおりとする。 10x 01y 001 この座標変換を適用すると,その作用として座標系が移動するため, 座標系の原点の座標は,現在のユーザ座標系における(x, y)に移動する。

    Translate

    Translate operator takes two operands ]]> Translate演算子は,次に示す2個のオペランドをとる。

  • <y: Number>
  • <x: Number> ]]>
  • <y: 数>
  • <x: 数>

    Translate operator is the same as ]]> 結果は返さない。 Translate演算子の作用は,次の処理を行った場合と同一とする。 {x y TranslateT Concat}

    RotateT

    RotateT operator takes one operand ]]> RotateT演算子は,次に示す1個のオペランドをとる。

  • <a: Number> ]]>
  • <a: 数>

    ここで,aは,度を単位とする角度で,次に示す1個の結果を返す。

  • <T: Transformation> ]]>
  • <T: 座標変換>

    ここで,Tは座標変換で,その行列表現は次のとおりとする。 cos a-sin a0 sin a cos a 0 0 01 この座標変換を適用すると,その作用として,ユーザ座標系をその現在の座標原点 を中心として反時計方向に角度でa度分回転する。

    Rotate

    Rotate operator takes one operand ]]> Rotate演算子は,次に示す1個のオペランドをとる。

  • <a: Number> ]]>
  • <a: 数>

    Rotate operator is the same as ]]> ここで,aは,角度で,結果は返さない。 Rotate演算子の作用は,次の処理を行った場合と同一とする。

  • {a RotateT Concat}

    ConcatT

    ConcatT operator takes two operands ]]> ConcatT演算子は,次に示す2個のオペランドをとる。

  • <T2: Transformation>
  • <T1: Transformation> ]]>
  • <T2: 座標変換>
  • <T1: 座標変換>

    そして,1個の結果を返す。

  • <T3: Transformation> ]]>
  • <T3: 座標変換>

    T3 = T1 × T2 . ]]> ここで,T3 = T1 × T2とする。

    Concat

    Concat operator takes a single operand ]]> Concat演算子は,次に示す1個のオペランドをとり,結果を返さない。

  • <T: Transformation> ]]>
  • <T: 座標変換>

    T0 is the Transformation (see ) that represents the CurrentTransformation at the time at which Concatis executed, then Concat changes its value to T × T0 . ]]> Concat演算子は,CurrentTransformationの値をT × T0に変更する。 ここで,T0は,Concatを実行した時点でのCurrentTransformationの 値を表す座標変換(参照)とする。

    SetTrans

    SetTrans operator takes a single operand ]]> SetTrans演算子は,次に示す1個のオペランドをとり, 結果を返さない。

  • <T: Transformation> ]]>
  • <T: 座標変換>

    CurrentTransformation Graphics State Variable to T × Ti where Ti is the Initial CurrentTransformation component of the Virtual Machine (see ). ]]> その作用は,CurrentTransformation作図状態変数にT × Tiを 設定することとする。 ここで,Tiは,仮想機械の初期CurrentTransformationとする (参照)。

    GetTrans

    GetTrans operator takes no operands and returns a single result ]]> GetTrans演算子は,オペランドをとらず,次の1個の結果を返す。

  • <T: Transformation> ]]>
  • <T: 座標変換>

    SetTrans} would set the CurrentTransformation Graphics State Variable to its current value. ]]> ここで,Tは,座標変換であって,{ T SetTrans } を実行した場合, CurrentTransformation作図状態変数にその現在値と同一の値が設定されるもの とする。