Perl で gdsii
実行環境
  Active Perl
     更新するには
ppm
  ppm
  DownLoad
  実行
Help
   perldoc GDS2
Examples
  basic-lines
  simple
  simple-sref
  aref
  circle
  circle-inverted
  sample-arc
  donut
  Inverted-Donuts
  Donuts_Combination
  Hello-World
  CP-array
  text2gds.pm
  rotate.pm
  rotate-rectangle
  arc.pm
  line-and-space-180
  triangle-array-nega
  sq_sleeve.pm
  TriangleGridStep
  triangle-array-nega-CP
  CirclesArray-SQ
  LargeCircles
  MA6-Alignment-mark.pm
  Alignment-Place
  Triangle-Grid
  Triangle-Grid-Wide
  ellipsis-polygons
  inscribe_polygon
  inscribe_polygon.pm
  inscribe_polygon-ellipsis.pm
  sleeving-by-square-sample
  sleeving-by-square.pm

Perl Perl/GDSII page
Download (as "rotate.pm")

rotate.pm

# -*- Perl -*-
package rotate;
sub rotate ($$$) {
    my ($x)     = shift;
    my ($y)     = shift;
    my ($angle) = shift;  # in degree
# ------------------------------------------------
#    X     cos(theta)  -sin(theta)   x
#       = 
#    Y     sin(theta)   cos(theta)   y
# ------------------------------------------------
    my ($theta) = $angle * 3.14159265 /180;

    ## https://mathwords.net/heimenkaiten

    my ($X) = $x * cos($theta) + $y * - sin($theta);
    my ($Y) = $x * sin($theta) + $y *   cos($theta);
    return ($X, $Y);
}

1;
Last Update: Mon, 21 Feb 2022 10:13:01 GMT 1.66 2008/03/08