SED navigation bar go to SED home page go to Dataplot home page go to NIST home page SED Home Page SED Staff SED Projects SED Products and Publications Search SED Pages
Dataplot Vol 2 Vol 1

TRANSFORM POINTS

Name:
    TRANSFORM POINTS
Type:
    LET Subcommand
Purpose:
    Given a set of (X,Y) pairs, perform a location, scaling, and rotation transformation.
Description:
    The location transformation is

      X' = X - Tx
      Y' = Y - Ty

    with Tx and Ty denoting the X and Y translation, respectively.

    The scaling transformation is

      X' = X*Sx
      Y' = Y*Sy

    with Sx and Sy denoting the X and Y scaling, respectively.

    The rotation transformation is

      X' = COS(THETA)*X + SIN(THETA)*Y
      Y' = -SIN(THETA)*X + COS(THETA)*Y

    with THETA denoting the angle of rotation (in radians).

Syntax:
    LET <yout> <xout>= TRANSFORM POINTS <y> <x> <ty> <tx> <sy> <sx> <theta>
                            <SUBSET/EXPCEPT/FOR qualification>
    where <y> is a variable containing the x-coordinates of the data points being transformed;
                <x> is a variable containing the y-coordinates of the data points being transformed;
                <ty> is a parameter containg the y-cooredinate translation;
                <tx> is a parameter containg the x-cooredinate translation;
                <sy> is a parameter containg the y-cooredinate scaling;
                <sx> is a parameter containg the x-cooredinate scaling;
                <theta> is a parameter that contains the angle of rotation; of the polygon;
                <yout> is a variable containing the y-coordinates of the transformed points;
                <xout> is a variable containing the x-coordinates of the transformed points;
    and where the <SUBSET/EXCEPT/FOR qualification> is optional.
Examples:
    LET Y2 X2 = TRANSFORM POINTS Y X TY TX SY SX THETA
Default:
    None
Synonyms:
    None
Related Commands:
    ANGRAD = Return the counter clockwise angle, in radians, of the angle determined by three points.
    DPNTLINE = Compute the perpindicular distance between a point and a line defined by a point and a slope.
    POINTS IN POLYGON = Determine whether points are in the interior of a convex polygon.
    CONVEX HULL = Determine the convex hull of a set of points.
    SLOPE = Compute the slope of the line determined by two points.
    EXTREME POINTS = Determine the extreme points of a set of points.
    LINE INTERSECTIONS = Determine the intersection points for a set of lines.
    PARALLEL LINE = Determine the coordinates for a point that defines a parallel line determined by a point and a line defined by two points.
    PERPINDICULAR LINE = Determine the coordinates for a point that defines a perpindicular line determined by a point and a line defined by two points.
Applications:
    Computational Geometry
Implementation Date:
    2012/10
Program:
     
    read x y
      0.5333000E+02  0.2357000E+02
      0.5037000E+02  0.1668000E+02
      0.1686000E+02 -0.6469000E+02
      0.5521000E+02  0.2713000E+02
      0.1395000E+02 -0.6794000E+02
      0.5414000E+02  0.2781000E+02
      0.2704000E+02 -0.4195000E+02
      0.1830000E+02 -0.6416000E+02
     -0.8881000E+02 -0.2991900E+03
      0.6442000E+02  0.5613000E+02
     -0.1728800E+03 -0.5288300E+03
      0.4743000E+02  0.1766000E+02
      0.3282400E+03  0.4791700E+03
      0.2137600E+03  0.1424400E+03
      0.2067600E+03  0.1877700E+03
      0.3593000E+02 -0.2923600E+03
      0.3637600E+03  0.3094700E+03
      0.2974600E+03  0.6332000E+02
      0.1759800E+03 -0.1644000E+03
      0.4257500E+03  0.3561300E+03
      0.6733000E+02  0.9115000E+02
      0.5081000E+02  0.2532000E+02
     -0.2029900E+03 -0.5509600E+03
      0.7737000E+02  0.6375000E+02
      0.3363100E+03  0.3074700E+03
      0.1296400E+03 -0.1771600E+03
      0.2421000E+02 -0.5091200E+03
      0.1670100E+03 -0.1446500E+03
      0.2401100E+03 -0.3796800E+03
      0.5067400E+03  0.4129400E+03
      0.5173100E+03  0.4183700E+03
      0.8339000E+02 -0.6446200E+03
      0.1908800E+03  0.3463800E+03
      0.1629900E+03  0.3044400E+03
     -0.1138500E+03 -0.4050300E+03
      0.2787200E+03  0.4979900E+03
     -0.7125000E+02 -0.4863700E+03
      0.2147300E+03  0.1820300E+03
     -0.1757900E+03 -0.5140500E+03
     -0.1993500E+03 -0.5823900E+03
      0.1438700E+03  0.2333900E+03
      0.2134000E+02 -0.6915000E+02
     -0.4354000E+02 -0.4289700E+03
      0.3219800E+03  0.4268300E+03
      0.2507000E+02 -0.2689300E+03
     -0.8324000E+02 -0.5685300E+03
      0.8540000E+02 -0.4379000E+03
      0.7870000E+02 -0.3830800E+03
     -0.1064000E+02 -0.6613600E+03
      0.2023700E+03 -0.3954000E+02
      0.2877000E+02 -0.3549000E+02
      0.1908000E+02 -0.5440000E+02
      0.3766000E+02 -0.1542000E+02
      0.5360000E+02  0.1845000E+02
     -0.1782900E+03 -0.5311500E+03
     -0.9508000E+02 -0.5267900E+03
      0.1183700E+03 -0.6679000E+02
      0.4384000E+02 -0.4773700E+03
      0.1847200E+03 -0.5284000E+02
      0.1714300E+03  0.3265600E+03
      0.1928600E+03  0.3423200E+03
     -0.1705300E+03 -0.4889800E+03
      0.4415000E+02  0.8400000E+01
     -0.1434000E+03 -0.4216400E+03
      0.6579000E+02  0.2837000E+02
    end of data
    .
    let tx = -614.1127
    let ty = -368.6171
    let sx = 0.0008
    let sy = 0.0029
    let theta = 1.1723
    .
    let yt2 xt2 = transform points y x ty tx sy sx theta
    .
    multiplot scale factor 2
    multiplot corner coordinates 5 5 95 95
    multiplot 2 2
    .
    line blank
    character circle
    character hw 1 0.75
    character fill on
    title offset 2
    title case asis
    .
    title Original Data
    plot y x
    .
    title Transformed Data
    tic mark offset units data
    tic mark offset 0.05 0.05
    limits 0 1
    major tic mark number 6
    plot yt2 xt2
        
    plot generated by sample program

Date created: 02/15/2013
Last updated: 02/15/2013
Please email comments on this WWW page to alan.heckert@nist.gov.