Math::Geometry::Construction::FixedPoint - independent user-defined point


Version 0.024


  my $p1 = $construction->add_point(position => [100, 150]);

  my $p2 = $construction->add_point('x' => 50, 'y' => 90,
                                    hidden => 1);

  my $p3 = $construction->add_point('x' => 70, 'y' => 130,
                                    style          => {stroke => 'red'},
                                    label          => 'A',
                                    label_offset_x => 5,
                                    label_offset_y => -5);


An instance of this class represents a user defined free point, as opposed to a derived point, e.g. an intersection point. An instance of this class got its position directly from the user. It is created by using the add_point method of Math::Geometry::Construction.


Public Attributes


The accessor returns a Math::Vector::Real object with the position of the point. To the constructor or mutator, you can give anything that Math::Geometry::Construction::Vector accepts. The constructor additionally supports explicit x and y arguments.


  # arrayref
  $construction->add_point(position => [1, 4]);
  $construction->position([5, -3]);
  $construction->position([4, -1, 7]);  # 7 is ignored

  # Math::Vector::Real object
  $construction->add_point(position => V(1, 4));
  $construction->position(V(5, -3));

  # x and y
  $construction->add_point('x' => 1, 'y' => 4);

See also Math::Geometry::Construction::Vector.

Note that you must not alter the elements of the Math::Vector::Real object directly although the class interface allows it. This will circumvent the tracking of changes that Math::Geometry::Construction performs in order to improve performance.

  $point = $construction->add_point([5, 7]);
  $pos   = $point->position;
  $pos->[0] = 6;             # wrong!
  $point->position([6, 7]);  # right


A point is currently always drawn as a circle. This might become more flexible in the future. size determines the size of the point in the output. For a circle it is its diameter. This parameter is currently undef by default, because the output falls back to radius (see below). When radius is removed, size will default to 6.


Half of size. This attribute is deprecated and might be removed in a future version. Use size instead.

General Output Attributes

See Math::Geometry::Construction::Output.



Called by the Construction object during output generation. Currently draws a circle of diameter size, but this might become more flexible in the future.


Class method returning $ID_TEMPLATE, which defaults to 'P%09d'.


Lutz Gehlen, <perl at>


Copyright 2011, 2013 Lutz Gehlen.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See for more information.