| 1 | package CXC::Astro::Regions::CIAO::Types; | ||
| 2 | |||
| 3 | # ABSTRACT: Types for CIAO Regions | ||
| 4 | |||
| 5 | 5 | ▶ | use v5.20; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 5 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 5 | our $VERSION = '0.04'; | |
| 9 | |||
| 10 | 5 | ▶ | use Types::Standard qw( Enum Bool Num Str StrMatch ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | 5 | ▶ | use Types::Common::Numeric qw( PositiveNum ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 12 | |||
| 13 | 5 | ▶ | use Type::Utils -all; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 14 | 5 | ▶ | use Regexp::Common qw( number ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 15 | use Type::Library | ||
| 16 | 5 | -base, | |
| 17 | -extends => [ 'Types::Common::Numeric', 'Types::Common::String', 'Types::Standard' ], | ||
| 18 | -declare => qw( | ||
| 19 | Angle | ||
| 20 | Length | ||
| 21 | PositionAsNum | ||
| 22 | Vertex | ||
| 23 | XPosition | ||
| 24 | YPosition | ||
| 25 | 5 | ▶ | ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 26 | |||
| 27 | 5 | ▶ | use CXC::Types::Astro::Coords 'Sexagesimal'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 28 | |||
| 29 | 5 | declare PositionAsNum, | |
| 30 | as StrMatch [qr{\A (?: $RE{num}{real} [d]?) \z}x]; | ||
| 31 | |||
| 32 | |||
| 33 | 5 | declare XPosition, as PositionAsNum | Sexagesimal [ -ra, -sep ]; | |
| 34 | 5 | declare YPosition, as PositionAsNum | Sexagesimal [ -dec, -sep ]; | |
| 35 | 5 | declare Vertex, as Tuple [ XPosition, YPosition ]; | |
| 36 | |||
| 37 | 5 | declare Length, as StrMatch [qr/\A$RE{num}{real} (["d]|[']{1,2})?\z/x]; | |
| 38 | |||
| 39 | 5 | declare Angle, as Num; | |
| 40 | |||
| 41 | 5 | 1; | |
| 42 | |||
| 43 | # | ||
| 44 | # This file is part of CXC-Astro-Regions | ||
| 45 | # | ||
| 46 | # This software is Copyright (c) 2023 by Smithsonian Astrophysical Observatory. | ||
| 47 | # | ||
| 48 | # This is free software, licensed under: | ||
| 49 | # | ||
| 50 | # The GNU General Public License, Version 3, June 2007 | ||
| 51 | # | ||
| 52 | |||
| 53 | __END__ | ||