<?xml version="1.0" encoding="UTF-8"?>
<!--
 * Copyright (C) INRIA -  Serge Steer Serge.Steer@inria.fr
 *
 * Copyright (C) 2012 - 2016 - Scilab Enterprises
 *
 * This file is hereby licensed under the terms of the GNU GPL v2.0,
 * pursuant to article 5.3.4 of the CeCILL v.2.1.
 * This file was originally licensed under the terms of the CeCILL v2.1,
 * and continues to be available under such terms.
 * For more information, see the COPYING file which you should have received
 * along with this program.
-->
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
          xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML"
          xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"
          xml:lang="ja" xml:id="orthProj">
    <refnamediv>
        <refname>orthProj</refname>
        <refpurpose>
            点の平面上のポリラインへの直交射影を計算する
        </refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>呼び出し手順</title>
        <synopsis>[d,ptp,ind,c] = orthProj(data,pt)</synopsis>
    </refsynopsisdiv>
    <refsection role="parameters">
        <title>引数</title>
        <variablelist>
            <varlistentry>
                <term>data</term>
                <listitem>
                    <para>
                        n 行 2 列配列. 最初の列にはポリラインのX座標,
                        2番目の列にはY座標を有します.
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>pt</term>
                <listitem>
                    <para>
                        2個のエントリを有する配列: 点の座標
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>d</term>
                <listitem>
                    <para>
                        指定した点とポリラインのデータ点の間の最小距離.
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>ptp</term>
                <listitem>
                    <para>
                        2個のエントリを有する配列: 距離が最小となる点の座標
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>ind</term>
                <listitem>
                    <para>
                        セグメント<literal>[ind ind+1]</literal>で
                        ポリラインに最も近い点となる&gt;.
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>c</term>
                <listitem>
                    <para>
                        直交射影の補間係数.
                    </para>
                </listitem>
            </varlistentry>
        </variablelist>
    </refsection>
    <refsection role="description">
        <title>説明</title>
        <para>
            平面上のポリラインへの点の直交射影を計算します.
        </para>
    </refsection>
    <refsection role="examples">
        <title>例</title>
        <programlisting role="example"><![CDATA[
    x=linspace(0,1,30)';
    y=sin(4*x.^3)/2;
    clf(), isoview()
    plot(x,y)
    pt=[0.7 0.3];
    plot(pt(1),pt(2),'xb')
    [d,ptp,ind,c]=orthProj([x y],pt);
    plot(x(ind:ind+1),y(ind:ind+1),'+r')
    xpoly([pt(1);ptp(1)],[pt(2);ptp(2)])
    e=gce();e.polyline_style=4;e.arrow_size_factor = 1.5;

    pt=[0.75 -0.3];
    plot(pt(1),pt(2),'xb')
    [d,ptp,ind,c]=orthProj([x y],pt);
    plot(x(ind:ind+1),y(ind:ind+1),'+r')
    xpoly([pt(1);ptp(1)],[pt(2);ptp(2)])
    e=gce();e.polyline_style=4;e.arrow_size_factor = 1.5;
    ]]></programlisting>
        <scilab:image>
            x=linspace(0,1,30)';
            y=sin(4*x.^3)/2;
            clf(), isoview()
            plot(x,y)
            pt=[0.7 0.3];
            plot(pt(1),pt(2),'xb')
            [d,ptp,ind,c]=orthProj([x y],pt);
            plot(x(ind:ind+1),y(ind:ind+1),'+r')
            xpoly([pt(1);ptp(1)],[pt(2);ptp(2)])
            e=gce();e.polyline_style=4;e.arrow_size_factor = 1.5;

            pt=[0.75 -0.3];
            plot(pt(1),pt(2),'xb')
            [d,ptp,ind,c]=orthProj([x y],pt);
            plot(x(ind:ind+1),y(ind:ind+1),'+r')
            xpoly([pt(1);ptp(1)],[pt(2);ptp(2)])
            e=gce();e.polyline_style=4;e.arrow_size_factor = 1.5;
        </scilab:image>
    </refsection>
    <refsection role="see also">
        <title>参照</title>
        <simplelist type="inline">
            <member>
                <link linkend="proj">proj</link>
            </member>
            <member>
                <link linkend="householder">householder</link>
            </member>
            <member>
                <link linkend="scaling">scaling</link>
            </member>
        </simplelist>
    </refsection>
</refentry>
