project_3Dpoint_to_2Dsectionコマンド マニュアル

(The documentation of project_3Dpoint_to_2Dsection command)

Last Update: 2022/07/06


◆機能・用途(Purpose)

3次元空間内の点を2次元鉛直断面に投影する。
Project a point in the 3D space onto a 2D vertical section.

このコマンドでは1度の実行で1地点を投影する。 多数地点を投影するにはこのコマンドを繰り返し呼ぶ出すスクリプトなどを作成して ループを回す必要がある。 また、2次元鉛直断面への投影ではz座標は変化しないので (x,y)座標の投影のみを行う。
This command projects one point in each run; to project multiple points, a script that repeatedly calls this command is needed. Only the (x,y) coordinate is projected, as the projection onto the 2D vertical section does not change the z coordinate.


◆ソースコード(Source code)

$YMAEDA_OPENTOOL_DIR/geography/src/project_3Dpoint_to_2Dsection.c


◆使用方法(Usage)

コマンドライン引数でパラメータを指定する。 パラメータの一覧を下表に示す。
Specify parameters by command-line arguments. The table below shows a list of parameters.


●「-」から始まらない引数 (Arguments not beginning with “-”)

このコマンドでは「-」から始まらない引数は存在しない。
This command does not have arguments not beginning with “-”.


●1つの「-」から始まる引数 (Arguments beginning with a single “-”)

このコマンドでは1つの「-」から始まる引数は存在しない。
This command does not have arguments beginning with a single “-”.


●「--パラメータ名=パラメータ値」の形式の引数 (Arguments of a form “--Parameter name=Parameter Value”)

「--パラメータ名=パラメータ値」の形式の引数は自由な順番で指定できる。 「-」から始まらない引数の間に挿入しても良い。 相反する指定がなされた場合には後の指定が優先される。 デフォルト値を持つパラメータは省略できる。
Arguments of a form “--Parameter name=Parameter Value” can be placed in an arbitrary order. They can even be inserted between arguments not beginning with “-”. In case of conflicting options being specified, the latter option has a higher priority. Parameters that have default values can be omitted.

パラメータ名
Parameter name
意味
Meaning
可能なパラメータ値
Allowed parameter values
デフォルト値
Default value
point 投影したい点の(x,y)座標xp
The (x,y) coordinate of the point to be projected (xp).
x座標とy座標をカンマ(,)で区切って並べた文字列。
A string composed of x- and y-coordinates separated by a comma (,).
省略不可
Cannot be omitted
origin 投影断面の一方の端(始点)の(x,y)座標xo
The (x,y) coordinate of one end (the origin) of the section to project (xo).
x座標とy座標をカンマ(,)で区切って並べた文字列。
A string composed of x- and y-coordinates separated by a comma (,).
省略不可
Cannot be omitted
destination 投影断面の他方の端(終点)の(x,y)座標xd
The (x,y) coordinate of the other end (the destination) of the section to project (xd).
x座標とy座標をカンマ(,)で区切って並べた文字列。
A string composed of x- and y-coordinates separated by a comma (,).
省略不可
Cannot be omitted
max_distance xpと投影断面との間の距離の許容最大値dmax
The maximum allowed distance, dmax, between xp and the section to project.
正の実数。
A positive real number.
省略時は距離の上限無しとなる。
When omitted, there is no upper limit of the distance.


◆動作(Behaviour)

xoを原点、xdを終点とする2次元鉛直断面上に xpを投影したときの水平位置が 標準出力に表示される。 但し、xpと投影断面との距離がdmaxを超える場合は 何も出力されない。
The horizontal location of xp, on the 2D vertical section from the origin at xo to the destination at xd, is displayed into the standard output. However, if the distance between xp and the section is greater than dmax, nothing is displayed.


◆使用例(Example)

project_3Dpoint_to_2Dsection --point=1500.0,1800.0 --origin=-1000.0,-2000.0 --destination=3000.0,4000.0


◆計算式(Formula)

投影したい点の座標をxp=(xp,yp)、 投影断面の原点をxo=(xo,yo)、終点をxd=(xd,yd)とする。 原点から終点に向かう方向とx軸とのなす角を反時計回りに測った角度を θとする。 このとき投影断面に沿った水平方向ベクトルは v=(cosθ,sinθ)となる。 これとxpxoとの内積が 投影地点の断面上での水平位置rであるので (1)r=(xpxo)v=(xpxo)cosθ+(ypyo)sinθ により計算できる。 また、xpと投影断面との距離は三平方の定理により (2)d=|xpxo|2r2 と計算できる。
Let xp=(xp,yp) be the point to project, and xo=(xo,yo) and xd=(xd,yd) be the origin and destination of the projection section, respectively. Let θ be the angle between the direction from the origin to the destination and the x-axis, measured counterclockwise. Then the horizontal directional vector of the section is given by v=(cosθ,sinθ). The inner product of v and xpxo gives the horizontal location, r, of the projection point on the section, which is calculated by eq. (1). The distance between xp and the section is then computed by eq. (2), according to Pythagorean theorem.