次の方法で共有


Curve.PointAndDerivatives メソッド (Visio)

曲線のパス上の任意の位置にある点と微分係数を返します。

構文

PointAndDerivatives (t, n, x, y, dxdt, dydt, ddxdt, ddydt)

Curve オブジェクトを表す変数。

パラメーター

名前 必須 / オプション データ型 説明
t 必須 Double 評価する曲線のパラメーター ドメインの値です。
n 必須 Integer 0: 点を取得、1: 点と 1 次微分係数を取得、2: 点および 1 次微分係数と 2 次微分係数を取得します。
x 必須 Double t の曲線の x 値を返 します。
y 必須 Double t での曲線の y 値を返 します
dxdt 必須 Double n> 0 の場合、t で一次導関数 (dx/dt) を返します。
dydt 必須 Double n 0 の場合、t で一次導関数 (dy/dt) >返します。
ddxdt 必須 Double n> 1 の場合、t で 2 番目の派生関数 (ddx/dt) を返します。
ddydt 必須 Double n> 1 の場合、t で 2 番目の派生関数 (ddy/dt) を返します。

戻り値

なし

解説

曲線のパラメーター ドメイン内にある点の座標、およびその 1 次微分係数と 2 次微分係数を取得するには、Curve オブジェクトの PointAndDerivatives メソッドを使用します。

Curve オブジェクトは、パラメーター ドメインの観点から説明されます。これは範囲 [Start(),End()]です。 PointAndDerivatives メソッドを使用すると、[Start(),End()]の外側で曲線のパスを推定できます。

この Microsoft Visual Basic for Applications (VBA) マクロは、ドキュメントのアクティブなページに楕円を描画し、それを取得し、その Paths コレクションと各 Path オブジェクトを反復処理して、曲線に沿ってさまざまなポイントの座標を表示します。 描画される図形は楕円であるため、パスは 1 つだけ、 Curve オブジェクトは 1 つだけです。

 
Sub PointAndDerivatives_Example() 
 
 Dim vsoShape As Visio.Shape 
 Dim vsoPaths As Visio.Paths 
 Dim vsoPath As Visio.Path 
 Dim vsoCurve As Visio.Curve 
 Dim dblStartpoint As Double 
 Dim dblXCoordinate As Double 
 Dim dblYCoordinate As Double 
 Dim dblFirstDerivativeX As Double 
 Dim dblFirstDerivativeY As Double 
 Dim dblSecondDerivativeX As Double 
 Dim dblSecondDerivativeY As Double 
 Dim intOuterLoopCounter As Integer 
 Dim intInnerLoopCounter As Integer 
 
 'Get the Paths collection for this shape. 
 Set vsoPaths = ActivePage.DrawOval(1, 1, 4, 4).Paths 
 
 'Iterate through the Path objects in the Paths collection. 
 For intOuterLoopCounter = 1 To vsoPaths.Count 
 Set vsoPath = vsoPaths.Item(intOuterLoopCounter) 
 Debug.Print "Path object " & intOuterLoopCounter 
 
 'Iterate through the curves in a Path object. 
 For intInnerLoopCounter = 1 To vsoPath.Count 
 
 Set vsoCurve = vsoPath(intInnerLoopCounter) 
 Debug.Print "Curve number " & intInnerLoopCounter 
 
 'Display the start point of the curve. 
 dblStartpoint = vsoCurve.Start 
 Debug.Print "Startpoint= " & dblStartpoint 
 
 'Use the PointAndDerivatives method to obtain 
 'a point and the first derivative at that point. 
 vsoCurve.PointAndDerivatives (dblStartpoint - 1), 1, _ 
 dblXCoordinate, dblYCoordinate, dblFirstDerivativeX, dblFirstDerivativeY, dblSecondDerivativeX, dblSecondDerivativeY 
 Debug.Print "PointAndDerivative= " & dblXCoordinate, dblYCoordinate, dblFirstDerivativeX, dblFirstDerivativeY 
 
 Next intInnerLoopCounter 
 Debug.Print "This path has " & intInnerLoopCounter - 1 & " curve object(s)." 
 
 Next intOuterLoopCounter 
 Debug.Print "This shape has " & intOuterLoopCounter - 1 & " path object(s)." 
 
End Sub

サポートとフィードバック

Office VBA またはこの説明書に関するご質問やフィードバックがありますか? サポートの受け方およびフィードバックをお寄せいただく方法のガイダンスについては、Office VBA のサポートおよびフィードバックを参照してください。