head	8.7;
access;
symbols;
locks; strict;
comment	@ * @;


8.7
date	2026.05.11.12.01.10;	author mcalabre;	state Exp;
branches;
next	8.6;

8.6
date	2026.03.29.13.53.56;	author mcalabre;	state Exp;
branches
	8.6.1.1;
next	8.5;

8.5
date	2025.12.06.13.47.41;	author mcalabre;	state Exp;
branches
	8.5.1.1;
next	8.4;

8.4
date	2024.10.28.13.56.17;	author mcalabre;	state Exp;
branches
	8.4.1.1;
next	8.3;

8.3
date	2024.05.13.16.33.00;	author mcalabre;	state Exp;
branches
	8.3.1.1;
next	8.2;

8.2
date	2023.11.16.10.00.30;	author mcalabre;	state Exp;
branches
	8.2.1.1;
next	8.1;

8.1
date	2023.07.05.17.12.07;	author mcalabre;	state Exp;
branches
	8.1.1.1;
next	8.0;

8.0
date	2023.07.01.06.15.05;	author mcalabre;	state Exp;
branches
	8.0.1.1;
next	7.13;

7.13
date	2022.10.07.03.43.35;	author mcalabre;	state Exp;
branches
	7.13.1.1;
next	7.12;

7.12
date	2022.09.09.04.57.58;	author mcalabre;	state Exp;
branches
	7.12.1.1;
next	7.11;

7.11
date	2022.04.26.06.13.52;	author mcalabre;	state Exp;
branches
	7.11.1.1;
next	7.10;

7.10
date	2022.04.23.14.25.15;	author mcalabre;	state Exp;
branches
	7.10.1.1;
next	7.9;

7.9
date	2022.03.25.15.14.49;	author mcalabre;	state Exp;
branches
	7.9.1.1;
next	7.8;

7.8
date	2022.03.25.06.11.49;	author mcalabre;	state Exp;
branches
	7.8.1.1;
next	7.7;

7.7
date	2021.07.12.06.36.49;	author mcalabre;	state Exp;
branches
	7.7.1.1;
next	7.6;

7.6
date	2021.04.13.12.57.01;	author mcalabre;	state Exp;
branches
	7.6.1.1;
next	7.5;

7.5
date	2021.03.20.05.54.58;	author mcalabre;	state Exp;
branches
	7.5.1.1;
next	7.4;

7.4
date	2021.01.31.02.24.52;	author mcalabre;	state Exp;
branches
	7.4.1.1;
next	7.3;

7.3
date	2020.06.03.03.37.03;	author mcalabre;	state Exp;
branches
	7.3.1.1;
next	7.2;

7.2
date	2020.03.09.07.31.23;	author mcalabre;	state Exp;
branches
	7.2.1.1;
next	7.1;

7.1
date	2019.12.31.13.25.19;	author mcalabre;	state Exp;
branches
	7.1.1.1;
next	6.4;

6.4
date	2019.08.15.09.30.18;	author mcalabre;	state Exp;
branches
	6.4.1.1;
next	6.3;

6.3
date	2019.07.12.07.33.39;	author mcalabre;	state Exp;
branches
	6.3.1.1;
next	6.2;

6.2
date	2018.10.20.10.03.14;	author mcalabre;	state Exp;
branches
	6.2.1.1;
next	6.1;

6.1
date	2018.10.19.08.35.17;	author mcalabre;	state Exp;
branches
	6.1.1.1;
next	5.20;

5.20
date	2018.10.05.05.32.41;	author mcalabre;	state Exp;
branches
	5.20.1.1;
next	5.19;

5.19
date	2018.07.26.15.37.05;	author mcalabre;	state Exp;
branches
	5.19.1.1;
next	5.18;

5.18
date	2018.01.10.08.32.14;	author mcalabre;	state Exp;
branches
	5.18.1.1;
next	5.17;

5.17
date	2017.09.18.08.44.24;	author mcalabre;	state Exp;
branches
	5.17.1.1;
next	5.16;

5.16
date	2017.01.15.04.25.02;	author mcalabre;	state Exp;
branches
	5.16.1.1;
next	5.15;

5.15
date	2016.04.05.12.55.11;	author mcalabre;	state Exp;
branches
	5.15.1.1;
next	5.14;

5.14
date	2016.02.07.10.49.32;	author mcalabre;	state Exp;
branches
	5.14.1.1;
next	5.13;

5.13
date	2016.01.26.08.51.15;	author mcalabre;	state Exp;
branches
	5.13.1.1;
next	5.12;

5.12
date	2015.11.15.02.13.01;	author mcalabre;	state Exp;
branches
	5.12.1.1;
next	5.11;

5.11
date	2015.10.18.09.13.06;	author mcalabre;	state Exp;
branches
	5.11.1.1;
next	5.10;

5.10
date	2015.10.09.08.19.16;	author mcalabre;	state Exp;
branches
	5.10.1.1;
next	5.9;

5.9
date	2015.07.21.09.20.03;	author mcalabre;	state Exp;
branches
	5.9.1.1;
next	5.8;

5.8
date	2015.07.08.11.04.01;	author mcalabre;	state Exp;
branches
	5.8.1.1;
next	5.7;

5.7
date	2015.06.29.02.44.17;	author mcalabre;	state Exp;
branches
	5.7.1.1;
next	5.6;

5.6
date	2015.06.14.07.11.25;	author mcalabre;	state Exp;
branches
	5.6.1.1;
next	5.5;

5.5
date	2015.05.05.13.16.32;	author mcalabre;	state Exp;
branches
	5.5.1.1;
next	5.4;

5.4
date	2015.04.21.14.41.06;	author mcalabre;	state Exp;
branches
	5.4.1.1;
next	5.3;

5.3
date	2015.04.21.02.50.52;	author mcalabre;	state Exp;
branches
	5.3.1.1;
next	5.2;

5.2
date	2015.04.15.12.35.08;	author mcalabre;	state Exp;
branches
	5.2.1.1;
next	5.1;

5.1
date	2015.04.07.10.56.38;	author mcalabre;	state Exp;
branches
	5.1.1.1;
next	5.0;

5.0
date	2015.04.05.12.25.01;	author mcalabre;	state Exp;
branches
	5.0.1.1;
next	4.25;

4.25
date	2014.12.14.14.29.37;	author mcalabre;	state Exp;
branches
	4.25.1.1;
next	4.24;

4.24
date	2014.09.18.15.25.01;	author mcalabre;	state Exp;
branches
	4.24.1.1;
next	4.23;

4.23
date	2014.05.13.05.50.52;	author mcalabre;	state Exp;
branches
	4.23.1.1;
next	4.22;

4.22
date	2014.04.12.15.03.53;	author mcalabre;	state Exp;
branches
	4.22.1.1;
next	4.21;

4.21
date	2014.03.24.05.12.28;	author mcalabre;	state Exp;
branches
	4.21.1.1;
next	4.20;

4.20
date	2013.12.18.05.42.50;	author mcalabre;	state Exp;
branches
	4.20.1.1;
next	4.19;

4.19
date	2013.09.29.14.17.52;	author mcalabre;	state Exp;
branches
	4.19.1.1;
next	4.18;

4.18
date	2013.07.13.10.00.05;	author mcalabre;	state Exp;
branches
	4.18.1.1;
next	4.17;

4.17
date	2013.01.29.05.29.21;	author cal103;	state Exp;
branches
	4.17.1.1;
next	4.16;

4.16
date	2012.11.07.04.42.45;	author cal103;	state Exp;
branches
	4.16.1.1;
next	4.15;

4.15
date	2012.09.26.14.26.06;	author cal103;	state Exp;
branches
	4.15.1.1;
next	4.14;

4.14
date	2012.07.13.10.02.32;	author cal103;	state Exp;
branches
	4.14.1.1;
next	4.13;

4.13
date	2012.03.14.07.39.30;	author cal103;	state Exp;
branches
	4.13.1.1;
next	4.12;

4.12
date	2012.02.29.07.57.57;	author cal103;	state Exp;
branches
	4.12.1.1;
next	4.11;

4.11
date	2012.02.20.23.30.02;	author cal103;	state Exp;
branches
	4.11.1.1;
next	4.10;

4.10
date	2012.02.05.23.41.44;	author cal103;	state Exp;
branches
	4.10.1.1;
next	4.9;

4.9
date	2012.01.24.05.40.29;	author cal103;	state Exp;
branches
	4.9.1.1;
next	4.8;

4.8
date	2011.08.15.08.05.54;	author cal103;	state Exp;
branches
	4.8.1.1;
next	4.7;

4.7
date	2011.02.07.07.03.42;	author cal103;	state Exp;
branches
	4.7.1.1;
next	4.6;

4.6
date	2010.11.16.06.15.31;	author cal103;	state Exp;
branches
	4.6.1.1;
next	4.5;

4.5
date	2010.07.16.07.01.26;	author cal103;	state Exp;
branches
	4.5.1.1;
next	4.4;

4.4
date	2009.08.06.07.45.31;	author cal103;	state Exp;
branches
	4.4.1.1;
next	4.3;

4.3
date	2007.12.27.05.35.51;	author cal103;	state Exp;
branches
	4.3.1.1;
next	4.2;

4.2
date	2005.09.22.02.15.15;	author cal103;	state Exp;
branches
	4.2.1.1;
next	4.1;

4.1
date	2005.08.22.07.44.13;	author cal103;	state Exp;
branches;
next	4.0;

4.0
date	2005.02.04.06.31.54;	author cal103;	state Exp;
branches;
next	3.6;

3.6
date	2004.08.25.05.35.49;	author cal103;	state Exp;
branches;
next	3.5;

3.5
date	2004.06.28.01.05.32;	author mcalabre;	state Exp;
branches;
next	3.4;

3.4
date	2004.02.11.00.23.05;	author mcalabre;	state Exp;
branches;
next	3.3;

3.3
date	2003.10.21.08.10.05;	author mcalabre;	state Exp;
branches;
next	3.2;

3.2
date	2003.09.09.04.40.16;	author mcalabre;	state Exp;
branches;
next	3.1;

3.1
date	2003.04.28.04.27.07;	author mcalabre;	state Exp;
branches;
next	3.0;

3.0
date	2003.04.01.04.16.39;	author mcalabre;	state Exp;
branches;
next	2.13;

2.13
date	2002.04.03.01.25.29;	author mcalabre;	state Exp;
branches;
next	2.12;

2.12
date	2001.11.15.02.57.09;	author mcalabre;	state Exp;
branches;
next	2.11;

2.11
date	2000.12.04.06.45.52;	author mcalabre;	state Exp;
branches;
next	2.10;

2.10
date	2000.05.10.04.44.05;	author mcalabre;	state Exp;
branches;
next	2.9;

2.9
date	2000.01.31.07.02.47;	author mcalabre;	state Exp;
branches;
next	2.8;

2.8
date	99.12.13.07.33.01;	author mcalabre;	state Exp;
branches;
next	2.7;

2.7
date	99.12.13.03.41.27;	author mcalabre;	state Exp;
branches;
next	2.6;

2.6
date	99.11.19.00.29.42;	author mcalabre;	state Exp;
branches;
next	2.5;

2.5
date	99.11.19.00.28.15;	author mcalabre;	state Exp;
branches;
next	2.4;

2.4
date	98.02.25.07.05.50;	author mcalabre;	state Exp;
branches;
next	2.3;

2.3
date	98.01.30.00.19.21;	author mcalabre;	state Exp;
branches;
next	2.2;

2.2
date	96.05.07.20.29.35;	author mcalabre;	state Exp;
branches;
next	2.1;

2.1
date	95.12.22.02.43.29;	author mcalabre;	state Exp;
branches;
next	2.0;

2.0
date	95.09.12.06.33.39;	author mcalabre;	state Exp;
branches;
next	1.2;

1.2
date	95.09.12.06.31.36;	author mcalabre;	state Exp;
branches;
next	1.1;

1.1
date	95.01.31.03.13.15;	author mcalabre;	state Exp;
branches;
next	;

4.2.1.1
date	2005.12.05.01.39.15;	author cal103;	state Exp;
branches;
next	4.2.1.2;

4.2.1.2
date	2005.12.16.03.48.31;	author cal103;	state Exp;
branches;
next	4.2.1.3;

4.2.1.3
date	2007.06.29.06.41.51;	author cal103;	state Exp;
branches;
next	4.2.1.4;

4.2.1.4
date	2007.12.03.05.12.59;	author cal103;	state Exp;
branches;
next	;

4.3.1.1
date	2007.12.27.13.24.32;	author cal103;	state Exp;
branches;
next	4.3.1.2;

4.3.1.2
date	2009.07.22.06.37.43;	author cal103;	state Exp;
branches;
next	;

4.4.1.1
date	2009.08.10.08.54.26;	author cal103;	state Exp;
branches;
next	4.4.1.2;

4.4.1.2
date	2010.01.19.03.44.00;	author cal103;	state Exp;
branches;
next	;

4.5.1.1
date	2010.07.16.07.05.32;	author cal103;	state Exp;
branches;
next	;

4.6.1.1
date	2010.11.16.06.16.19;	author cal103;	state Exp;
branches;
next	4.6.1.2;

4.6.1.2
date	2011.01.14.06.33.44;	author cal103;	state Exp;
branches;
next	;

4.7.1.1
date	2011.02.07.07.04.23;	author cal103;	state Exp;
branches;
next	4.7.1.2;

4.7.1.2
date	2011.08.12.04.50.57;	author cal103;	state Exp;
branches;
next	;

4.8.1.1
date	2011.08.15.08.07.06;	author cal103;	state Exp;
branches;
next	4.8.1.2;

4.8.1.2
date	2012.01.24.05.23.30;	author cal103;	state Exp;
branches;
next	;

4.9.1.1
date	2012.01.24.05.41.46;	author cal103;	state Exp;
branches;
next	;

4.10.1.1
date	2012.02.05.23.42.47;	author cal103;	state Exp;
branches;
next	;

4.11.1.1
date	2012.02.20.23.31.13;	author cal103;	state Exp;
branches;
next	;

4.12.1.1
date	2012.02.29.07.59.11;	author cal103;	state Exp;
branches;
next	;

4.13.1.1
date	2012.03.14.07.40.38;	author cal103;	state Exp;
branches;
next	4.13.1.2;

4.13.1.2
date	2012.07.13.03.37.00;	author cal103;	state Exp;
branches;
next	;

4.14.1.1
date	2012.07.13.10.04.50;	author cal103;	state Exp;
branches;
next	;

4.15.1.1
date	2012.09.26.14.27.52;	author cal103;	state Exp;
branches;
next	;

4.16.1.1
date	2012.11.07.04.45.57;	author cal103;	state Exp;
branches;
next	4.16.1.2;

4.16.1.2
date	2013.01.29.05.10.40;	author cal103;	state Exp;
branches;
next	;

4.17.1.1
date	2013.01.29.05.32.33;	author cal103;	state Exp;
branches;
next	4.17.1.2;

4.17.1.2
date	2013.07.12.04.08.06;	author mcalabre;	state Exp;
branches;
next	;

4.18.1.1
date	2013.07.13.10.02.38;	author mcalabre;	state Exp;
branches;
next	;

4.19.1.1
date	2013.09.29.14.20.40;	author mcalabre;	state Exp;
branches;
next	;

4.20.1.1
date	2013.12.18.05.46.56;	author mcalabre;	state Exp;
branches;
next	4.20.1.2;

4.20.1.2
date	2014.03.21.06.13.38;	author mcalabre;	state Exp;
branches;
next	4.20.1.3;

4.20.1.3
date	2014.03.21.06.26.03;	author mcalabre;	state Exp;
branches;
next	4.20.1.4;

4.20.1.4
date	2014.03.22.04.42.30;	author mcalabre;	state Exp;
branches;
next	4.20.1.5;

4.20.1.5
date	2014.03.24.05.07.05;	author mcalabre;	state Exp;
branches;
next	;

4.21.1.1
date	2014.03.24.05.15.29;	author mcalabre;	state Exp;
branches;
next	;

4.22.1.1
date	2014.04.12.15.06.33;	author mcalabre;	state Exp;
branches;
next	;

4.23.1.1
date	2014.05.13.05.53.51;	author mcalabre;	state Exp;
branches;
next	;

4.24.1.1
date	2014.09.18.15.28.11;	author mcalabre;	state Exp;
branches;
next	;

4.25.1.1
date	2014.12.14.14.32.46;	author mcalabre;	state Exp;
branches;
next	4.25.1.2;

4.25.1.2
date	2015.01.06.01.01.52;	author mcalabre;	state Exp;
branches;
next	;

5.0.1.1
date	2015.04.05.12.28.02;	author mcalabre;	state Exp;
branches;
next	;

5.1.1.1
date	2015.04.07.11.01.11;	author mcalabre;	state Exp;
branches;
next	;

5.2.1.1
date	2015.04.15.12.39.16;	author mcalabre;	state Exp;
branches;
next	;

5.3.1.1
date	2015.04.21.02.54.03;	author mcalabre;	state Exp;
branches;
next	;

5.4.1.1
date	2015.04.21.14.44.29;	author mcalabre;	state Exp;
branches;
next	;

5.5.1.1
date	2015.05.05.13.21.02;	author mcalabre;	state Exp;
branches;
next	;

5.6.1.1
date	2015.06.14.07.14.46;	author mcalabre;	state Exp;
branches;
next	;

5.7.1.1
date	2015.06.29.02.47.25;	author mcalabre;	state Exp;
branches;
next	;

5.8.1.1
date	2015.07.08.11.07.20;	author mcalabre;	state Exp;
branches;
next	;

5.9.1.1
date	2015.07.21.09.28.10;	author mcalabre;	state Exp;
branches;
next	;

5.10.1.1
date	2015.10.09.08.22.37;	author mcalabre;	state Exp;
branches;
next	;

5.11.1.1
date	2015.10.18.09.16.29;	author mcalabre;	state Exp;
branches;
next	;

5.12.1.1
date	2015.11.15.02.16.16;	author mcalabre;	state Exp;
branches;
next	5.12.1.2;

5.12.1.2
date	2016.01.25.05.17.40;	author mcalabre;	state Exp;
branches;
next	;

5.13.1.1
date	2016.01.26.08.54.34;	author mcalabre;	state Exp;
branches;
next	;

5.14.1.1
date	2016.02.07.10.52.46;	author mcalabre;	state Exp;
branches;
next	;

5.15.1.1
date	2016.04.05.12.58.37;	author mcalabre;	state Exp;
branches;
next	5.15.1.2;

5.15.1.2
date	2017.01.15.04.14.22;	author mcalabre;	state Exp;
branches;
next	;

5.16.1.1
date	2017.01.15.04.29.01;	author mcalabre;	state Exp;
branches;
next	;

5.17.1.1
date	2017.09.18.08.46.00;	author mcalabre;	state Exp;
branches;
next	5.17.1.2;

5.17.1.2
date	2018.01.10.08.26.04;	author mcalabre;	state Exp;
branches;
next	;

5.18.1.1
date	2018.01.10.08.33.04;	author mcalabre;	state Exp;
branches;
next	;

5.19.1.1
date	2018.07.26.15.41.41;	author mcalabre;	state Exp;
branches;
next	;

5.20.1.1
date	2018.10.05.05.33.33;	author mcalabre;	state Exp;
branches;
next	;

6.1.1.1
date	2018.10.19.08.36.15;	author mcalabre;	state Exp;
branches;
next	;

6.2.1.1
date	2018.10.20.10.04.15;	author mcalabre;	state Exp;
branches;
next	6.2.1.2;

6.2.1.2
date	2019.05.10.02.01.28;	author mcalabre;	state Exp;
branches;
next	;

6.3.1.1
date	2019.07.12.07.34.37;	author mcalabre;	state Exp;
branches;
next	;

6.4.1.1
date	2019.08.15.09.31.29;	author mcalabre;	state Exp;
branches;
next	6.4.1.2;

6.4.1.2
date	2019.12.31.03.28.29;	author mcalabre;	state Exp;
branches;
next	;

7.1.1.1
date	2019.12.31.13.28.19;	author mcalabre;	state Exp;
branches;
next	;

7.2.1.1
date	2020.03.09.07.34.50;	author mcalabre;	state Exp;
branches;
next	;

7.3.1.1
date	2020.06.03.03.38.11;	author mcalabre;	state Exp;
branches;
next	7.3.1.2;

7.3.1.2
date	2020.08.17.11.20.48;	author mcalabre;	state Exp;
branches;
next	7.3.1.3;

7.3.1.3
date	2021.01.19.14.10.01;	author mcalabre;	state Exp;
branches;
next	7.3.1.4;

7.3.1.4
date	2021.01.28.12.31.20;	author mcalabre;	state Exp;
branches;
next	;

7.4.1.1
date	2021.01.31.02.26.24;	author mcalabre;	state Exp;
branches;
next	;

7.5.1.1
date	2021.03.20.05.56.42;	author mcalabre;	state Exp;
branches;
next	;

7.6.1.1
date	2021.04.13.13.00.36;	author mcalabre;	state Exp;
branches;
next	;

7.7.1.1
date	2021.07.12.06.38.27;	author mcalabre;	state Exp;
branches;
next	7.7.1.2;

7.7.1.2
date	2022.03.25.06.05.59;	author mcalabre;	state Exp;
branches;
next	;

7.8.1.1
date	2022.03.25.06.14.15;	author mcalabre;	state Exp;
branches;
next	;

7.9.1.1
date	2022.03.25.15.16.40;	author mcalabre;	state Exp;
branches;
next	;

7.10.1.1
date	2022.04.23.14.26.54;	author mcalabre;	state Exp;
branches;
next	;

7.11.1.1
date	2022.04.26.06.15.32;	author mcalabre;	state Exp;
branches;
next	;

7.12.1.1
date	2022.09.09.05.00.36;	author mcalabre;	state Exp;
branches;
next	;

7.13.1.1
date	2022.10.07.03.45.47;	author mcalabre;	state Exp;
branches;
next	7.13.1.2;

7.13.1.2
date	2023.06.15.04.17.20;	author mcalabre;	state Exp;
branches;
next	;

8.0.1.1
date	2023.07.01.06.22.44;	author mcalabre;	state Exp;
branches;
next	;

8.1.1.1
date	2023.07.05.17.15.00;	author mcalabre;	state Exp;
branches;
next	;

8.2.1.1
date	2023.11.16.10.05.58;	author mcalabre;	state Exp;
branches;
next	8.2.1.2;

8.2.1.2
date	2024.04.02.14.06.10;	author mcalabre;	state Exp;
branches;
next	;

8.3.1.1
date	2024.05.13.16.35.40;	author mcalabre;	state Exp;
branches;
next	;

8.4.1.1
date	2024.10.28.13.58.41;	author mcalabre;	state Exp;
branches;
next	8.4.1.2;

8.4.1.2
date	2025.12.06.13.37.17;	author mcalabre;	state Exp;
branches;
next	;

8.5.1.1
date	2025.12.06.14.05.16;	author mcalabre;	state Exp;
branches;
next	8.5.1.2;

8.5.1.2
date	2026.03.29.13.36.17;	author mcalabre;	state Exp;
branches;
next	;

8.6.1.1
date	2026.03.29.14.19.27;	author mcalabre;	state Exp;
branches;
next	8.6.1.2;

8.6.1.2
date	2026.04.10.14.56.15;	author mcalabre;	state Exp;
branches;
next	8.6.1.3;

8.6.1.3
date	2026.04.10.14.59.14;	author mcalabre;	state Exp;
branches;
next	;


desc
@Program to test closure of the WCSLIB spherical projection routines.
@


8.7
log
@WCSLIB 8.7
@
text
@/*============================================================================
  WCSLIB 8.7 - an implementation of the FITS WCS standard.
  Copyright (C) 1995-2026, Mark Calabretta

  This file is part of WCSLIB.

  WCSLIB is free software: you can redistribute it and/or modify it under the
  terms of the GNU Lesser General Public License as published by the Free
  Software Foundation, either version 3 of the License, or (at your option)
  any later version.

  WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY
  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for
  more details.

  You should have received a copy of the GNU Lesser General Public License
  along with WCSLIB.  If not, see http://www.gnu.org/licenses.

  Author: Mark Calabretta, Australia Telescope National Facility, CSIRO.
  http://www.atnf.csiro.au/computing/software/wcs
  $Id: tprj1.c,v 8.6.1.3 2026/04/10 14:59:14 mcalabre Exp mcalabre $
*=============================================================================
*
* tproj1 tests spherical projections for closure.
*
*---------------------------------------------------------------------------*/

#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

#include <wcstrig.h>
#include <prj.h>

int projex(char pcode[4], struct prjprm *prj, int north, int south,
           double tol);

int main()

{
  const double tol = 1.0e-9;


  printf(
    "Testing closure of WCSLIB spherical projection routines (tprj1.c)\n"
    "-----------------------------------------------------------------\n");

  // List status return messages.
  printf("\nList of prj status return values:\n");
  for (int status = 1; status <= 4; status++) {
    printf("%4d: %s.\n", status, prj_errmsg[status]);
  }

  printf("\n");


  struct prjprm prj;
  prjini(&prj);

  int nFail = 0;

  // AZP: zenithal/azimuthal perspective.
  prj.pv[1] =   0.5;
  prj.pv[2] =  30.0;
  nFail += projex("AZP", &prj, 90, 5, tol);

  // SZP: slant zenithal perspective.
  prj.pv[1] =   0.5;
  prj.pv[2] = 210.0;
  prj.pv[3] =  60.0;
  nFail += projex("SZP", &prj, 90, -90, tol);

  // TAN: gnomonic.
  nFail += projex("TAN", &prj, 90, 5, tol);

  // STG: stereographic.
  nFail += projex("STG", &prj, 90, -85, tol);

  // SIN: orthographic/synthesis.
  prj.pv[1] = -0.3;
  prj.pv[2] =  0.5;
  nFail += projex("SIN", &prj, 90, 45, tol);

  // ARC: zenithal/azimuthal equidistant.
  nFail += projex("ARC", &prj, 90, -90, tol);

  // ZPN: zenithal/azimuthal polynomial.
  prj.pv[0] =  0.00000;
  prj.pv[1] =  0.95000;
  prj.pv[2] = -0.02500;
  prj.pv[3] = -0.15833;
  prj.pv[4] =  0.00208;
  prj.pv[5] =  0.00792;
  prj.pv[6] = -0.00007;
  prj.pv[7] = -0.00019;
  prj.pv[8] =  0.00000;
  prj.pv[9] =  0.00000;
  nFail += projex("ZPN", &prj, 90, 10, tol);

  // ZEA: zenithal/azimuthal equal area.
  nFail += projex("ZEA", &prj, 90, -85, tol);

  // AIR: Airy's zenithal projection.
  prj.pv[1] = 45.0;
  nFail += projex("AIR", &prj, 90, -85, tol);

  // CYP: cylindrical perspective.
  prj.pv[1] = 3.0;
  prj.pv[2] = 0.8;
  nFail += projex("CYP", &prj, 90, -90, tol);

  // CEA: cylindrical equal area.
  prj.pv[1] = 0.75;
  nFail += projex("CEA", &prj, 90, -90, tol);

  // CAR: plate carree.
  nFail += projex("CAR", &prj, 90, -90, tol);

  // MER: Mercator's.
  nFail += projex("MER", &prj, 85, -85, tol);

  // SFL: Sanson-Flamsteed.
  nFail += projex("SFL", &prj, 90, -90, tol);

  // PAR: parabolic.
  nFail += projex("PAR", &prj, 90, -90, tol);

  // MOL: Mollweide's projection.
  nFail += projex("MOL", &prj, 90, -90, tol);

  // AIT: Hammer-Aitoff.
  nFail += projex("AIT", &prj, 90, -90, tol);

  // COP: conic perspective.
  prj.pv[1] =  60.0;
  prj.pv[2] =  15.0;
  nFail += projex("COP", &prj, 90, -25, tol);

  // COE: conic equal area.
  prj.pv[1] =  60.0;
  prj.pv[2] = -15.0;
  nFail += projex("COE", &prj, 90, -90, tol);

  // COD: conic equidistant.
  prj.pv[1] = -60.0;
  prj.pv[2] =  15.0;
  nFail += projex("COD", &prj, 90, -90, tol);

  // COO: conic orthomorphic.
  prj.pv[1] = -60.0;
  prj.pv[2] = -15.0;
  nFail += projex("COO", &prj, 85, -90, tol);

  // BON: Bonne's projection.
  prj.pv[1] = 30.0;
  nFail += projex("BON", &prj, 90, -90, tol);

  // PCO: polyconic.
  nFail += projex("PCO", &prj, 90, -90, tol);

  // TSC: tangential spherical cube.
  nFail += projex("TSC", &prj, 90, -90, tol);

  // CSC: COBE quadrilateralized spherical cube.
  nFail += projex("CSC", &prj, 90, -90, 4.0e-2);

  // QSC: quadrilateralized spherical cube.
  nFail += projex("QSC", &prj, 90, -90, tol);

  // HPX: HEALPix projection.
  prj.pv[1] = 4.0;
  prj.pv[2] = 3.0;
  nFail += projex("HPX", &prj, 90, -90, tol);

  // XPH: HEALPix polar, aka "butterfly" projection.
  nFail += projex("XPH", &prj, 90, -90, tol);


  if (nFail) {
    printf("\nFAIL: %d closure residuals exceed reporting tolerance.\n",
      nFail);
  } else {
    printf("\nPASS: All closure residuals are within reporting tolerance.\n");
  }

  return nFail;
}


/*----------------------------------------------------------------------------
*   projex() exercises the spherical projection routines.
*
*   Given:
*      pcode[4]  char     Projection code.
*      north     int      Northern cutoff latitude, degrees.
*      south     int      Southern cutoff latitude, degrees.
*      tol       double   Reporting tolerance, degrees.
*
*   Given and returned:
*      prj       prjprm*  Projection parameters.
*
*   Function return value:
*                int      Number of results exceeding reporting tolerance.
*---------------------------------------------------------------------------*/

int projex(
  char pcode[4],
  struct prjprm *prj,
  int north,
  int south,
  double tol)

{
  // Uncomment the next line to test alternative initializations of
  // projection parameters.
  // prj->r0 = R2D;

  strncpy(prj->code, pcode, 4);
  printf("Testing %s; latitudes%3d to%4d, reporting tolerance%8.1e deg.\n",
    prj->code, north, south, tol);

  double dlngmx = 0.0;
  double dlatmx = 0.0;

  prjset(prj);

  int    nFail = 0;
  int    stat1[361], stat2[361];
  double lat2[361], lng1[361], lng2[361], x[361], y[361];
  for (int lat = north; lat >= south; lat--) {
    double lat1 = (double)lat;

    for (int j = 0, lng = -180; lng <= 180; lng++, j++) {
      lng1[j] = (double)lng;
    }

    if (prj->prjs2x(prj, 361, 1, 1, 1, lng1, &lat1, x, y, stat1) == 1) {
      printf("   %3s(S2X) ERROR 1: %s\n", pcode, prj_errmsg[1]);
      continue;
    }

    if (prj->prjx2s(prj, 361, 0, 1, 1, x, y, lng2, lat2, stat2) == 1) {
      printf("   %3s(X2S) ERROR 1: %s\n", pcode, prj_errmsg[1]);
      continue;
    }

    for (int j = 0; j < 361; j++) {
      if (stat1[j]) continue;

      if (stat2[j]) {
        nFail++;
        printf("   %3s(X2S): lng1 =%20.15f  lat1 =%20.15f\n",
          pcode, lng1[j], lat1);
        printf("                x =%20.15f     y =%20.15f\n",
          x[j], y[j]);
        printf("             lng2 =%20.15f  lat2 =%20.15f  ERROR%3d\n",
          lng2[j], lat2[j], stat2[j]);
        continue;
      }

      double dlng = fabs(lng2[j] - lng1[j]);
      if (dlng > 180.0) dlng = fabs(dlng-360.0);
      if (abs(lat) != 90 && dlng > dlngmx) dlngmx = dlng;
      double dlat = fabs(lat2[j] - lat1);
      if (dlat > dlatmx) dlatmx = dlat;

      if (dlat > tol) {
        nFail++;
        printf("        %3s: lng1 =%20.15f  lat1 =%20.15f\n",
          pcode, lng1[j], lat1);
        printf("                x =%20.15f     y =%20.15f\n",
          x[j], y[j]);
        printf("             lng2 =%20.15f  lat2 =%20.15f\n",
          lng2[j], lat2[j]);
      } else if (abs(lat) != 90) {
        if (dlng > tol) {
          nFail++;
          printf("        %3s: lng1 =%20.15f  lat1 =%20.15f\n",
            pcode, lng1[j], lat1);
          printf("                x =%20.15f     y =%20.15f\n",
            x[j], y[j]);
          printf("             lng2 =%20.15f  lat2 =%20.15f\n",
            lng2[j], lat2[j]);
        }
      }
    }
  }

  printf("             Maximum residual (sky): lng%8.1e  lat%8.1e\n",
    dlngmx, dlatmx);


  // Test closure in the neighbourhood of the reference point.
  double r = 1.0, x1[25], y1[25];
  x1[12] = y1[12] = 0.0;
  for (int i = 0; i < 12; i++) {
    x1[i] = -r;
    y1[i] = -r;
    x1[24-i] = r;
    y1[24-i] = r;

    r /= 10.0;
  }

  int    statr[25][25], status;
  double latr[25][25], lngr[25][25], x2[25][25], y2[25][25];
  if ((status = prj->prjx2s(prj, 25, 25, 1, 1, x1, y1, lngr[0], latr[0],
                            statr[0]))) {
    printf("   %3s(X2S) ERROR: %s\n", pcode, prj_errmsg[status]);

  } else if ((status = prj->prjs2x(prj, 625, 0, 1, 1, lngr[0], latr[0],
                                   x2[0], y2[0], statr[0]))) {
    printf("   %3s(S2X) ERROR: %s\n", pcode, prj_errmsg[status]);

  } else {
    double drmax = 0.0;
    for (int j = 0; j < 25; j++) {
      for (int i = 0; i < 25; i++) {
        double dx = x2[j][i] - x1[i];
        double dy = y2[j][i] - y1[j];
        double dr = sqrt(dx*dx + dy*dy);

        if (dr > drmax) drmax = dr;
        if (dr > tol) {
          nFail++;
          printf("        %3s:   x1 =%20.15f    y1 =%20.15f\n",
            pcode, x1[i], y1[j]);
          printf("              lng =%20.15f   lat =%20.15f\n",
            lngr[j][i], latr[j][i]);
          printf("               x2 =%20.15f    y2 =%20.15f\n",
            x2[j][i], y2[j][i]);
        }
      }
    }

    printf("             Maximum residual (ref):  dR%8.1e\n", drmax);
  }

  prjini(prj);

  return nFail;
}
@


8.6
log
@WCSLIB 8.6
@
text
@d2 1
a2 1
  WCSLIB 8.6 - an implementation of the FITS WCS standard.
d22 1
a22 1
  $Id: tprj1.c,v 8.5.1.2 2026/03/29 13:36:17 mcalabre Exp mcalabre $
a42 1
  int  nFail = 0, status;
a43 1
  struct prjprm prj;
d52 1
a52 1
  for (status = 1; status <= 4; status++) {
d59 1
d62 2
a215 10
  int    lat, lng, nFail = 0, stat1[361], stat2[361], statr[25][25], status;
  register int i, j;
  double dlat, dlatmx, dlng, dlngmx, dr, drmax, dx, dy;
  double lat1, lat2[361], lng1[361], lng2[361], x[361], y[361];
  double latr[25][25], lngr[25][25], r, x1[25], x2[25][25], y1[25],
         y2[25][25];


  strcpy(prj->code, pcode);

d220 1
d224 2
a225 2
  dlngmx = 0.0;
  dlatmx = 0.0;
a227 2
  for (lat = north; lat >= south; lat--) {
    lat1 = (double)lat;
d229 7
a235 1
    for (j = 0, lng = -180; lng <= 180; lng++, j++) {
d249 1
a249 1
    for (j = 0; j < 361; j++) {
d263 1
a263 1
      dlng = fabs(lng2[j] - lng1[j]);
d266 1
a266 1
      dlat = fabs(lat2[j] - lat1);
d296 1
a296 1
  r = 1.0;
d298 1
a298 1
  for (i = 0; i < 12; i++) {
d307 2
d318 6
a323 6
    drmax = 0.0;
    for (j = 0; j < 25; j++) {
      for (i = 0; i < 25; i++) {
        dx = x2[j][i] - x1[i];
        dy = y2[j][i] - y1[j];
        dr = sqrt(dx*dx + dy*dy);
@


8.6.1.1
log
@WCSLIB 8.6 development branch.
@
text
@d22 1
a22 1
  $Id: tprj1.c,v 8.6 2026/03/29 13:53:56 mcalabre Exp $
@


8.6.1.2
log
@Converted to C99-style intermingled variable declarations.
@
text
@d22 1
a22 1
  $Id: tprj1.c,v 8.6.1.1 2026/03/29 14:19:27 mcalabre Exp mcalabre $
d43 1
d45 1
d54 1
a54 1
  for (int status = 1; status <= 4; status++) {
a60 1
  struct prjprm prj;
a62 2
  int nFail = 0;

d215 10
a228 1
  strcpy(prj->code, pcode);
d232 2
a233 2
  double dlngmx = 0.0;
  double dlatmx = 0.0;
d236 2
d239 1
a239 7
  int    nFail = 0;
  int    stat1[361], stat2[361];
  double lat2[361], lng1[361], lng2[361], x[361], y[361];
  for (int lat = north; lat >= south; lat--) {
    double lat1 = (double)lat;

    for (int j = 0, lng = -180; lng <= 180; lng++, j++) {
d253 1
a253 1
    for (int j = 0; j < 361; j++) {
d267 1
a267 1
      double dlng = fabs(lng2[j] - lng1[j]);
d270 1
a270 1
      double dlat = fabs(lat2[j] - lat1);
d300 1
a300 1
  double r = 1.0, x1[25], y1[25];
d302 1
a302 1
  for (int i = 0; i < 12; i++) {
a310 2
  int    statr[25][25], status;
  double latr[25][25], lngr[25][25], x2[25][25], y2[25][25];
d320 6
a325 6
    double drmax = 0.0;
    for (int j = 0; j < 25; j++) {
      for (int i = 0; i < 25; i++) {
        double dx = x2[j][i] - x1[i];
        double dy = y2[j][i] - y1[j];
        double dr = sqrt(dx*dx + dy*dy);
@


8.6.1.3
log
@Inconsequential changes prompted by clang-tidy:
 - Replaced use of strcpy() with strncpy()
   (clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling).
@
text
@d22 1
a22 1
  $Id: tprj1.c,v 8.6.1.2 2026/04/10 14:56:15 mcalabre Exp mcalabre $
d220 1
a220 1
  strncpy(prj->code, pcode, 4);
@


8.5
log
@WCSLIB 8.5
@
text
@d2 2
a3 2
  WCSLIB 8.5 - an implementation of the FITS WCS standard.
  Copyright (C) 1995-2025, Mark Calabretta
d21 2
a22 2
  http://www.atnf.csiro.au/people/Mark.Calabretta
  $Id: tprj1.c,v 8.4.1.2 2025/12/06 13:37:17 mcalabre Exp mcalabre $
@


8.5.1.1
log
@WCSLIB 8.5 development branch.
@
text
@d22 1
a22 1
  $Id: tprj1.c,v 8.5 2025/12/06 13:47:41 mcalabre Exp $
@


8.5.1.2
log
@Updated date in copyright notice.
@
text
@d3 1
a3 1
  Copyright (C) 1995-2026, Mark Calabretta
d21 2
a22 2
  http://www.atnf.csiro.au/computing/software/wcs
  $Id: tprj1.c,v 8.5.1.1 2025/12/06 14:05:16 mcalabre Exp mcalabre $
@


8.4
log
@WCSLIB 8.4
@
text
@d2 2
a3 2
  WCSLIB 8.4 - an implementation of the FITS WCS standard.
  Copyright (C) 1995-2024, Mark Calabretta
d22 1
a22 1
  $Id: tprj1.c,v 8.3.1.1 2024/05/13 16:35:40 mcalabre Exp mcalabre $
@


8.4.1.1
log
@WCSLIB 8.4 development branch.
@
text
@d22 1
a22 1
  $Id: tprj1.c,v 8.4 2024/10/28 13:56:17 mcalabre Exp $
@


8.4.1.2
log
@Updated date in copyright notice.
@
text
@d3 1
a3 1
  Copyright (C) 1995-2025, Mark Calabretta
d22 1
a22 1
  $Id: tprj1.c,v 8.4.1.1 2024/10/28 13:58:41 mcalabre Exp mcalabre $
@


8.3
log
@WCSLIB 8.3
@
text
@d2 1
a2 1
  WCSLIB 8.3 - an implementation of the FITS WCS standard.
d22 1
a22 1
  $Id: tprj1.c,v 8.2.1.2 2024/04/02 14:06:10 mcalabre Exp mcalabre $
@


8.3.1.1
log
@WCSLIB 8.3 development branch.
@
text
@d22 1
a22 1
  $Id: tprj1.c,v 8.3 2024/05/13 16:33:00 mcalabre Exp $
@


8.2
log
@WCSLIB 8.2
@
text
@d2 2
a3 2
  WCSLIB 8.2 - an implementation of the FITS WCS standard.
  Copyright (C) 1995-2023, Mark Calabretta
d22 1
a22 1
  $Id: tprj1.c,v 8.1.1.1 2023/07/05 17:15:00 mcalabre Exp mcalabre $
@


8.2.1.1
log
@WCSLIB 8.2 development branch.
@
text
@d22 1
a22 1
  $Id: tprj1.c,v 8.2 2023/11/16 10:00:30 mcalabre Exp $
@


8.2.1.2
log
@Updated date in copyright notice.
@
text
@d3 1
a3 1
  Copyright (C) 1995-2024, Mark Calabretta
d22 1
a22 1
  $Id: tprj1.c,v 8.2.1.1 2023/11/16 10:05:58 mcalabre Exp mcalabre $
@


8.1
log
@WCSLIB 8.1
@
text
@d2 1
a2 1
  WCSLIB 8.1 - an implementation of the FITS WCS standard.
d22 1
a22 1
  $Id: tprj1.c,v 8.0.1.1 2023/07/01 06:22:44 mcalabre Exp mcalabre $
@


8.1.1.1
log
@WCSLIB 8.1 development branch.
@
text
@d22 1
a22 1
  $Id: tprj1.c,v 8.1 2023/07/05 17:12:07 mcalabre Exp $
@


8.0
log
@WCSLIB 8.0
@
text
@d2 1
a2 1
  WCSLIB 8.0 - an implementation of the FITS WCS standard.
d22 1
a22 1
  $Id: tprj1.c,v 7.13.1.2 2023/06/15 04:17:20 mcalabre Exp mcalabre $
@


8.0.1.1
log
@WCSLIB 8.0 development branch.
@
text
@d22 1
a22 1
  $Id: tprj1.c,v 8.0 2023/07/01 06:15:05 mcalabre Exp $
@


7.13
log
@WCSLIB 7.13
@
text
@d2 2
a3 2
  WCSLIB 7.13 - an implementation of the FITS WCS standard.
  Copyright (C) 1995-2022, Mark Calabretta
d22 1
a22 1
  $Id: tprj1.c,v 7.12.1.1 2022/09/09 05:00:36 mcalabre Exp mcalabre $
@


7.13.1.1
log
@WCSLIB 7.13 development branch.
@
text
@d22 1
a22 1
  $Id: tprj1.c,v 7.13 2022/10/07 03:43:35 mcalabre Exp $
@


7.13.1.2
log
@Updated date in copyright notice.
@
text
@d3 1
a3 1
  Copyright (C) 1995-2023, Mark Calabretta
d22 1
a22 1
  $Id: tprj1.c,v 7.13.1.1 2022/10/07 03:45:47 mcalabre Exp mcalabre $
@


7.12
log
@WCSLIB 7.12
@
text
@d2 1
a2 1
  WCSLIB 7.12 - an implementation of the FITS WCS standard.
d22 1
a22 1
  $Id: tprj1.c,v 7.11.1.1 2022/04/26 06:15:32 mcalabre Exp mcalabre $
@


7.12.1.1
log
@WCSLIB 7.12 development branch.
@
text
@d22 1
a22 1
  $Id: tprj1.c,v 7.12 2022/09/09 04:57:58 mcalabre Exp $
@


7.11
log
@WCSLIB 7.11
@
text
@d2 1
a2 1
  WCSLIB 7.11 - an implementation of the FITS WCS standard.
d22 1
a22 1
  $Id: tprj1.c,v 7.10.1.1 2022/04/23 14:26:54 mcalabre Exp mcalabre $
@


7.11.1.1
log
@WCSLIB 7.11 development branch.
@
text
@d22 1
a22 1
  $Id: tprj1.c,v 7.11 2022/04/26 06:13:52 mcalabre Exp $
@


7.10
log
@WCSLIB 7.10
@
text
@d2 1
a2 1
  WCSLIB 7.10 - an implementation of the FITS WCS standard.
d22 1
a22 1
  $Id: tprj1.c,v 7.9.1.1 2022/03/25 15:16:40 mcalabre Exp mcalabre $
@


7.10.1.1
log
@WCSLIB 7.10 development branch.
@
text
@d22 1
a22 1
  $Id: tprj1.c,v 7.10 2022/04/23 14:25:15 mcalabre Exp $
@


7.9
log
@WCSLIB 7.9
@
text
@d2 1
a2 1
  WCSLIB 7.9 - an implementation of the FITS WCS standard.
d22 1
a22 1
  $Id: tprj1.c,v 7.8.1.1 2022/03/25 06:14:15 mcalabre Exp mcalabre $
@


7.9.1.1
log
@WCSLIB 7.9 development branch.
@
text
@d22 1
a22 1
  $Id: tprj1.c,v 7.9 2022/03/25 15:14:49 mcalabre Exp $
@


7.8
log
@WCSLIB 7.8
@
text
@d2 1
a2 1
  WCSLIB 7.8 - an implementation of the FITS WCS standard.
d22 1
a22 1
  $Id: tprj1.c,v 7.7.1.2 2022/03/25 06:05:59 mcalabre Exp mcalabre $
@


7.8.1.1
log
@WCSLIB 7.8 development branch.
@
text
@d22 1
a22 1
  $Id: tprj1.c,v 7.8 2022/03/25 06:11:49 mcalabre Exp $
@


7.7
log
@WCSLIB 7.7
@
text
@d2 2
a3 2
  WCSLIB 7.7 - an implementation of the FITS WCS standard.
  Copyright (C) 1995-2021, Mark Calabretta
d22 1
a22 1
  $Id: tprj1.c,v 7.6.1.1 2021/04/13 13:00:36 mcalabre Exp mcalabre $
@


7.7.1.1
log
@WCSLIB 7.7 development branch.
@
text
@d22 1
a22 1
  $Id: tprj1.c,v 7.7 2021/07/12 06:36:49 mcalabre Exp $
@


7.7.1.2
log
@Updated date in copyright notice.
@
text
@d3 1
a3 1
  Copyright (C) 1995-2022, Mark Calabretta
d22 1
a22 1
  $Id: tprj1.c,v 7.7.1.1 2021/07/12 06:38:27 mcalabre Exp mcalabre $
@


7.6
log
@WCSLIB 7.6
@
text
@d2 1
a2 1
  WCSLIB 7.6 - an implementation of the FITS WCS standard.
d22 1
a22 1
  $Id: tprj1.c,v 7.5.1.1 2021/03/20 05:56:42 mcalabre Exp mcalabre $
@


7.6.1.1
log
@WCSLIB 7.6 development branch.
@
text
@d22 1
a22 1
  $Id: tprj1.c,v 7.6 2021/04/13 12:57:01 mcalabre Exp $
@


7.5
log
@WCSLIB 7.5
@
text
@d2 1
a2 1
  WCSLIB 7.5 - an implementation of the FITS WCS standard.
d22 1
a22 1
  $Id: tprj1.c,v 7.4.1.1 2021/01/31 02:26:24 mcalabre Exp mcalabre $
@


7.5.1.1
log
@WCSLIB 7.5 development branch.
@
text
@d22 1
a22 1
  $Id: tprj1.c,v 7.5 2021/03/20 05:54:58 mcalabre Exp $
@


7.4
log
@WCSLIB 7.4
@
text
@d2 1
a2 1
  WCSLIB 7.4 - an implementation of the FITS WCS standard.
d22 1
a22 1
  $Id: tprj1.c,v 7.3.1.4 2021/01/28 12:31:20 mcalabre Exp mcalabre $
@


7.4.1.1
log
@WCSLIB 7.4 development branch.
@
text
@d22 1
a22 1
  $Id: tprj1.c,v 7.4 2021/01/31 02:24:52 mcalabre Exp $
@


7.3
log
@WCSLIB 7.3
@
text
@d2 2
a3 3

  WCSLIB 7.3 - an implementation of the FITS WCS standard.
  Copyright (C) 1995-2020, Mark Calabretta
a19 2
  Direct correspondence concerning WCSLIB to mark@@calabretta.id.au

d22 1
a22 1
  $Id: tprj1.c,v 7.2.1.1 2020/03/09 07:34:50 mcalabre Exp mcalabre $
d52 1
a52 1
  /* List status return messages. */
d63 1
a63 1
  /* AZP: zenithal/azimuthal perspective. */
d68 1
a68 1
  /* SZP: slant zenithal perspective. */
d74 1
a74 1
  /* TAN: gnomonic. */
d77 1
a77 1
  /* STG: stereographic. */
d80 1
a80 1
  /* SIN: orthographic/synthesis. */
d85 1
a85 1
  /* ARC: zenithal/azimuthal equidistant. */
d88 1
a88 1
  /* ZPN: zenithal/azimuthal polynomial. */
d101 1
a101 1
  /* ZEA: zenithal/azimuthal equal area. */
d104 1
a104 1
  /* AIR: Airy's zenithal projection. */
d108 1
a108 1
  /* CYP: cylindrical perspective. */
d113 1
a113 1
  /* CEA: cylindrical equal area. */
d117 1
a117 1
  /* CAR: plate carree. */
d120 1
a120 1
  /* MER: Mercator's. */
d123 1
a123 1
  /* SFL: Sanson-Flamsteed. */
d126 1
a126 1
  /* PAR: parabolic. */
d129 1
a129 1
  /* MOL: Mollweide's projection. */
d132 1
a132 1
  /* AIT: Hammer-Aitoff. */
d135 1
a135 1
  /* COP: conic perspective. */
d140 1
a140 1
  /* COE: conic equal area. */
d145 1
a145 1
  /* COD: conic equidistant. */
d150 1
a150 1
  /* COO: conic orthomorphic. */
d155 1
a155 1
  /* BON: Bonne's projection. */
d159 1
a159 1
  /* PCO: polyconic. */
d162 1
a162 1
  /* TSC: tangential spherical cube. */
d165 1
a165 1
  /* CSC: COBE quadrilateralized spherical cube. */
d168 1
a168 1
  /* QSC: quadrilateralized spherical cube. */
d171 1
a171 1
  /* HPX: HEALPix projection. */
d176 1
a176 1
  /* XPH: HEALPix polar, aka "butterfly" projection. */
d225 3
a227 3
  /* Uncomment the next line to test alternative initializations of */
  /* projection parameters.                                         */
  /* prj->r0 = R2D; */
d299 1
a299 1
  /* Test closure in the neighbourhood of the reference point. */
@


7.3.1.1
log
@WCSLIB 7.3 development branch.
@
text
@d25 1
a25 1
  $Id: tprj1.c,v 7.3 2020/06/03 03:37:03 mcalabre Exp $
@


7.3.1.2
log
@Switched to C99 style commenting (i.e. using //) within the code.
@
text
@d2 1
d25 1
a25 1
  $Id: tprj1.c,v 7.3.1.1 2020/06/03 03:38:11 mcalabre Exp mcalabre $
d55 1
a55 1
  // List status return messages.
d66 1
a66 1
  // AZP: zenithal/azimuthal perspective.
d71 1
a71 1
  // SZP: slant zenithal perspective.
d77 1
a77 1
  // TAN: gnomonic.
d80 1
a80 1
  // STG: stereographic.
d83 1
a83 1
  // SIN: orthographic/synthesis.
d88 1
a88 1
  // ARC: zenithal/azimuthal equidistant.
d91 1
a91 1
  // ZPN: zenithal/azimuthal polynomial.
d104 1
a104 1
  // ZEA: zenithal/azimuthal equal area.
d107 1
a107 1
  // AIR: Airy's zenithal projection.
d111 1
a111 1
  // CYP: cylindrical perspective.
d116 1
a116 1
  // CEA: cylindrical equal area.
d120 1
a120 1
  // CAR: plate carree.
d123 1
a123 1
  // MER: Mercator's.
d126 1
a126 1
  // SFL: Sanson-Flamsteed.
d129 1
a129 1
  // PAR: parabolic.
d132 1
a132 1
  // MOL: Mollweide's projection.
d135 1
a135 1
  // AIT: Hammer-Aitoff.
d138 1
a138 1
  // COP: conic perspective.
d143 1
a143 1
  // COE: conic equal area.
d148 1
a148 1
  // COD: conic equidistant.
d153 1
a153 1
  // COO: conic orthomorphic.
d158 1
a158 1
  // BON: Bonne's projection.
d162 1
a162 1
  // PCO: polyconic.
d165 1
a165 1
  // TSC: tangential spherical cube.
d168 1
a168 1
  // CSC: COBE quadrilateralized spherical cube.
d171 1
a171 1
  // QSC: quadrilateralized spherical cube.
d174 1
a174 1
  // HPX: HEALPix projection.
d179 1
a179 1
  // XPH: HEALPix polar, aka "butterfly" projection.
d228 3
a230 3
  // Uncomment the next line to test alternative initializations of
  // projection parameters.
  // prj->r0 = R2D;
d302 1
a302 1
  // Test closure in the neighbourhood of the reference point.
@


7.3.1.3
log
@Updated date in copyright notice.
@
text
@d3 1
a3 1
  Copyright (C) 1995-2021, Mark Calabretta
d24 1
a24 1
  $Id: tprj1.c,v 7.3.1.2 2020/08/17 11:20:48 mcalabre Exp mcalabre $
@


7.3.1.4
log
@Removed my email address from the copyright notice.
@
text
@d20 2
d24 1
a24 1
  $Id: tprj1.c,v 7.3.1.3 2021/01/19 14:10:01 mcalabre Exp mcalabre $
@


7.2
log
@WCSLIB 7.2
@
text
@d3 1
a3 1
  WCSLIB 7.2 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: tprj1.c,v 7.1.1.1 2019/12/31 13:28:19 mcalabre Exp mcalabre $
@


7.2.1.1
log
@WCSLIB 7.2 development branch.
@
text
@d25 1
a25 1
  $Id: tprj1.c,v 7.2 2020/03/09 07:31:23 mcalabre Exp $
@


7.1
log
@WCSLIB 7.1
@
text
@d3 1
a3 1
  WCSLIB 7.1 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: tprj1.c,v 6.4.1.2 2019/12/31 03:28:29 mcalabre Exp mcalabre $
@


7.1.1.1
log
@WCSLIB 7.1 development branch.
@
text
@d25 1
a25 1
  $Id: tprj1.c,v 7.1 2019/12/31 13:25:19 mcalabre Exp $
@


6.4
log
@WCSLIB 6.4
@
text
@d3 2
a4 2
  WCSLIB 6.4 - an implementation of the FITS WCS standard.
  Copyright (C) 1995-2019, Mark Calabretta
d25 1
a25 1
  $Id: tprj1.c,v 6.3.1.1 2019/07/12 07:34:37 mcalabre Exp mcalabre $
@


6.4.1.1
log
@WCSLIB 6.4 development branch.
@
text
@d25 1
a25 1
  $Id: tprj1.c,v 6.4 2019/08/15 09:30:18 mcalabre Exp $
@


6.4.1.2
log
@Updated date in copyright notice.
@
text
@d4 1
a4 1
  Copyright (C) 1995-2020, Mark Calabretta
d25 1
a25 1
  $Id: tprj1.c,v 6.4.1.1 2019/08/15 09:31:29 mcalabre Exp mcalabre $
@


6.3
log
@WCSLIB 6.3
@
text
@d3 1
a3 1
  WCSLIB 6.3 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: tprj1.c,v 6.2.1.2 2019/05/10 02:01:28 mcalabre Exp mcalabre $
@


6.3.1.1
log
@WCSLIB 6.3 development branch.
@
text
@d25 1
a25 1
  $Id: tprj1.c,v 6.3 2019/07/12 07:33:39 mcalabre Exp $
@


6.2
log
@WCSLIB 6.2
@
text
@d3 2
a4 2
  WCSLIB 6.2 - an implementation of the FITS WCS standard.
  Copyright (C) 1995-2018, Mark Calabretta
d25 1
a25 1
  $Id: tprj1.c,v 6.1.1.1 2018/10/19 08:36:15 mcalabre Exp mcalabre $
@


6.2.1.1
log
@WCSLIB 6.2 development branch.
@
text
@d25 1
a25 1
  $Id: tprj1.c,v 6.2 2018/10/20 10:03:14 mcalabre Exp $
@


6.2.1.2
log
@Updated date in copyright notice.
@
text
@d4 1
a4 1
  Copyright (C) 1995-2019, Mark Calabretta
d25 1
a25 1
  $Id: tprj1.c,v 6.2.1.1 2018/10/20 10:04:15 mcalabre Exp mcalabre $
@


6.1
log
@WCSLIB 6.1
@
text
@d3 1
a3 1
  WCSLIB 6.1 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: tprj1.c,v 5.20.1.1 2018/10/05 05:33:33 mcalabre Exp mcalabre $
@


6.1.1.1
log
@WCSLIB 6.1 development branch.
@
text
@d25 1
a25 1
  $Id: tprj1.c,v 6.1 2018/10/19 08:35:17 mcalabre Exp $
@


5.20
log
@WCSLIB 5.20
@
text
@d3 1
a3 1
  WCSLIB 5.20 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: tprj1.c,v 5.19.1.1 2018/07/26 15:41:41 mcalabre Exp mcalabre $
@


5.20.1.1
log
@WCSLIB 5.20 development branch.
@
text
@d25 1
a25 1
  $Id: tprj1.c,v 5.20 2018/10/05 05:32:41 mcalabre Exp $
@


5.19
log
@WCSLIB 5.19
@
text
@d3 1
a3 1
  WCSLIB 5.19 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: tprj1.c,v 5.18.1.1 2018/01/10 08:33:04 mcalabre Exp mcalabre $
@


5.19.1.1
log
@WCSLIB 5.19 development branch.
@
text
@d25 1
a25 1
  $Id: tprj1.c,v 5.19 2018/07/26 15:37:05 mcalabre Exp $
@


5.18
log
@WCSLIB 5.18
@
text
@d3 1
a3 1
  WCSLIB 5.18 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: tprj1.c,v 5.17.1.2 2018/01/10 08:26:04 mcalabre Exp mcalabre $
@


5.18.1.1
log
@WCSLIB 5.18 development branch.
@
text
@d25 1
a25 1
  $Id: tprj1.c,v 5.18 2018/01/10 08:32:14 mcalabre Exp $
@


5.17
log
@WCSLIB 5.17
@
text
@d3 2
a4 2
  WCSLIB 5.17 - an implementation of the FITS WCS standard.
  Copyright (C) 1995-2017, Mark Calabretta
d25 1
a25 1
  $Id: tprj1.c,v 5.16.1.1 2017/01/15 04:29:01 mcalabre Exp mcalabre $
@


5.17.1.1
log
@WCSLIB 5.17 development branch.
@
text
@d25 1
a25 1
  $Id: tprj1.c,v 5.17 2017/09/18 08:44:24 mcalabre Exp $
@


5.17.1.2
log
@Updated date in copyright notice.
@
text
@d4 1
a4 1
  Copyright (C) 1995-2018, Mark Calabretta
d25 1
a25 1
  $Id: tprj1.c,v 5.17.1.1 2017/09/18 08:46:00 mcalabre Exp mcalabre $
@


5.16
log
@WCSLIB 5.16
@
text
@d3 1
a3 1
  WCSLIB 5.16 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: tprj1.c,v 5.15.1.2 2017/01/15 04:14:22 mcalabre Exp mcalabre $
@


5.16.1.1
log
@WCSLIB 5.16 development branch.
@
text
@d25 1
a25 1
  $Id: tprj1.c,v 5.16 2017/01/15 04:25:02 mcalabre Exp $
@


5.15
log
@WCSLIB 5.15
@
text
@d3 2
a4 2
  WCSLIB 5.15 - an implementation of the FITS WCS standard.
  Copyright (C) 1995-2016, Mark Calabretta
d25 1
a25 1
  $Id: tprj1.c,v 5.14.1.1 2016/02/07 10:52:46 mcalabre Exp mcalabre $
@


5.15.1.1
log
@WCSLIB 5.15 development branch.
@
text
@d25 1
a25 1
  $Id: tprj1.c,v 5.15 2016/04/05 12:55:11 mcalabre Exp $
@


5.15.1.2
log
@Updated date in copyright notice.
@
text
@d4 1
a4 1
  Copyright (C) 1995-2017, Mark Calabretta
d25 1
a25 1
  $Id: tprj1.c,v 5.15.1.1 2016/04/05 12:58:37 mcalabre Exp mcalabre $
@


5.14
log
@WCSLIB 5.14
@
text
@d3 1
a3 1
  WCSLIB 5.14 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: tprj1.c,v 5.13.1.1 2016/01/26 08:54:34 mcalabre Exp mcalabre $
@


5.14.1.1
log
@WCSLIB 5.14 development branch.
@
text
@d25 1
a25 1
  $Id: tprj1.c,v 5.14 2016/02/07 10:49:32 mcalabre Exp $
@


5.13
log
@WCSLIB 5.13
@
text
@d3 1
a3 1
  WCSLIB 5.13 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: tprj1.c,v 5.12.1.2 2016/01/25 05:17:40 mcalabre Exp mcalabre $
@


5.13.1.1
log
@WCSLIB 5.13 development branch.
@
text
@d25 1
a25 1
  $Id: tprj1.c,v 5.13 2016/01/26 08:51:15 mcalabre Exp $
@


5.12
log
@WCSLIB 5.12
@
text
@d3 2
a4 2
  WCSLIB 5.12 - an implementation of the FITS WCS standard.
  Copyright (C) 1995-2015, Mark Calabretta
d25 1
a25 1
  $Id: tprj1.c,v 5.11.1.1 2015/10/18 09:16:29 mcalabre Exp mcalabre $
@


5.12.1.1
log
@WCSLIB 5.12 development branch.
@
text
@d25 1
a25 1
  $Id: tprj1.c,v 5.12 2015/11/15 02:13:01 mcalabre Exp $
@


5.12.1.2
log
@Updated date in copyright notice.
@
text
@d4 1
a4 1
  Copyright (C) 1995-2016, Mark Calabretta
d25 1
a25 1
  $Id: tprj1.c,v 5.12.1.1 2015/11/15 02:16:16 mcalabre Exp mcalabre $
@


5.11
log
@WCSLIB 5.11
@
text
@d3 1
a3 1
  WCSLIB 5.11 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: tprj1.c,v 5.10.1.1 2015/10/09 08:22:37 mcalabre Exp mcalabre $
@


5.11.1.1
log
@WCSLIB 5.11 development branch.
@
text
@d25 1
a25 1
  $Id: tprj1.c,v 5.11 2015/10/18 09:13:06 mcalabre Exp $
@


5.10
log
@WCSLIB 5.10
@
text
@d3 1
a3 1
  WCSLIB 5.10 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: tprj1.c,v 5.9.1.1 2015/07/21 09:28:10 mcalabre Exp mcalabre $
@


5.10.1.1
log
@WCSLIB 5.10 development branch.
@
text
@d25 1
a25 1
  $Id: tprj1.c,v 5.10 2015/10/09 08:19:16 mcalabre Exp $
@


5.9
log
@WCSLIB 5.9
@
text
@d3 1
a3 1
  WCSLIB 5.9 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: tprj1.c,v 5.8.1.1 2015/07/08 11:07:20 mcalabre Exp mcalabre $
@


5.9.1.1
log
@WCSLIB 5.9 development branch.
@
text
@d25 1
a25 1
  $Id: tprj1.c,v 5.9 2015/07/21 09:20:03 mcalabre Exp $
@


5.8
log
@WCSLIB 5.8
@
text
@d3 1
a3 1
  WCSLIB 5.8 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: tprj1.c,v 5.7.1.1 2015/06/29 02:47:25 mcalabre Exp mcalabre $
@


5.8.1.1
log
@WCSLIB 5.8 development branch.
@
text
@d25 1
a25 1
  $Id: tprj1.c,v 5.8 2015/07/08 11:04:01 mcalabre Exp $
@


5.7
log
@WCSLIB 5.7
@
text
@d3 1
a3 1
  WCSLIB 5.7 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: tprj1.c,v 5.6.1.1 2015/06/14 07:14:46 mcalabre Exp mcalabre $
@


5.7.1.1
log
@WCSLIB 5.7 development branch.
@
text
@d25 1
a25 1
  $Id: tprj1.c,v 5.7 2015/06/29 02:44:17 mcalabre Exp $
@


5.6
log
@WCSLIB 5.6
@
text
@d3 1
a3 1
  WCSLIB 5.6 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: tprj1.c,v 5.5.1.1 2015/05/05 13:21:02 mcalabre Exp mcalabre $
@


5.6.1.1
log
@WCSLIB 5.6 development branch.
@
text
@d25 1
a25 1
  $Id: tprj1.c,v 5.6 2015/06/14 07:11:25 mcalabre Exp $
@


5.5
log
@WCSLIB 5.5
@
text
@d3 1
a3 1
  WCSLIB 5.5 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: tprj1.c,v 5.4.1.1 2015/04/21 14:44:29 mcalabre Exp mcalabre $
@


5.5.1.1
log
@WCSLIB 5.5 development branch.
@
text
@d25 1
a25 1
  $Id: tprj1.c,v 5.5 2015/05/05 13:16:32 mcalabre Exp $
@


5.4
log
@WCSLIB 5.4
@
text
@d3 1
a3 1
  WCSLIB 5.4 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: tprj1.c,v 5.3.1.1 2015/04/21 02:54:03 mcalabre Exp mcalabre $
@


5.4.1.1
log
@WCSLIB 5.4 development branch.
@
text
@d25 1
a25 1
  $Id: tprj1.c,v 5.4 2015/04/21 14:41:06 mcalabre Exp $
@


5.3
log
@WCSLIB 5.3
@
text
@d3 1
a3 1
  WCSLIB 5.3 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: tprj1.c,v 5.2.1.1 2015/04/15 12:39:16 mcalabre Exp mcalabre $
@


5.3.1.1
log
@WCSLIB 5.3 development branch.
@
text
@d25 1
a25 1
  $Id: tprj1.c,v 5.3 2015/04/21 02:50:52 mcalabre Exp $
@


5.2
log
@WCSLIB 5.2
@
text
@d3 1
a3 1
  WCSLIB 5.2 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: tprj1.c,v 5.1.1.1 2015/04/07 11:01:11 mcalabre Exp mcalabre $
@


5.2.1.1
log
@WCSLIB 5.2 development branch.
@
text
@d25 1
a25 1
  $Id: tprj1.c,v 5.2 2015/04/15 12:35:08 mcalabre Exp $
@


5.1
log
@WCSLIB 5.1
@
text
@d3 1
a3 1
  WCSLIB 5.1 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: tprj1.c,v 5.0.1.1 2015/04/05 12:28:02 mcalabre Exp mcalabre $
@


5.1.1.1
log
@WCSLIB 5.1 development branch.
@
text
@d25 1
a25 1
  $Id: tprj1.c,v 5.1 2015/04/07 10:56:38 mcalabre Exp $
@


5.0
log
@WCSLIB 5.0
@
text
@d3 1
a3 1
  WCSLIB 5.0 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: tprj1.c,v 4.25.1.2 2015/01/06 01:01:52 mcalabre Exp mcalabre $
@


5.0.1.1
log
@WCSLIB 5.0 development branch.
@
text
@d25 1
a25 1
  $Id: tprj1.c,v 5.0 2015/04/05 12:25:01 mcalabre Exp $
@


4.25
log
@WCSLIB 4.25
@
text
@d3 2
a4 2
  WCSLIB 4.25 - an implementation of the FITS WCS standard.
  Copyright (C) 1995-2014, Mark Calabretta
d25 1
a25 1
  $Id: tprj1.c,v 4.24.1.1 2014/09/18 15:28:11 mcalabre Exp mcalabre $
@


4.25.1.1
log
@WCSLIB 4.25 development branch.
@
text
@d25 1
a25 1
  $Id: tprj1.c,v 4.25 2014/12/14 14:29:37 mcalabre Exp $
@


4.25.1.2
log
@Updated date in copyright notice.
@
text
@d4 1
a4 1
  Copyright (C) 1995-2015, Mark Calabretta
d25 1
a25 1
  $Id: tprj1.c,v 4.25.1.1 2014/12/14 14:32:46 mcalabre Exp mcalabre $
@


4.24
log
@WCSLIB 4.24
@
text
@d3 1
a3 1
  WCSLIB 4.24 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: tprj1.c,v 4.23.1.1 2014/05/13 05:53:51 mcalabre Exp mcalabre $
@


4.24.1.1
log
@WCSLIB 4.24 development branch.
@
text
@d25 1
a25 1
  $Id: tprj1.c,v 4.24 2014/09/18 15:25:01 mcalabre Exp $
@


4.23
log
@WCSLIB 4.23
@
text
@d3 1
a3 1
  WCSLIB 4.23 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: tprj1.c,v 4.22.1.1 2014/04/12 15:06:33 mcalabre Exp mcalabre $
@


4.23.1.1
log
@WCSLIB 4.23 development branch.
@
text
@d25 1
a25 1
  $Id: tprj1.c,v 4.23 2014/05/13 05:50:52 mcalabre Exp $
@


4.22
log
@WCSLIB 4.22
@
text
@d3 1
a3 1
  WCSLIB 4.22 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: tprj1.c,v 4.21.1.1 2014/03/24 05:15:29 mcalabre Exp mcalabre $
@


4.22.1.1
log
@WCSLIB 4.22 development branch.
@
text
@d25 1
a25 1
  $Id: tprj1.c,v 4.22 2014/04/12 15:03:53 mcalabre Exp $
@


4.21
log
@WCSLIB 4.21
@
text
@d3 1
a3 1
  WCSLIB 4.21 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: tprj1.c,v 4.20.1.5 2014/03/24 05:07:05 mcalabre Exp mcalabre $
@


4.21.1.1
log
@WCSLIB 4.21 development branch.
@
text
@d25 1
a25 1
  $Id: tprj1.c,v 4.21 2014/03/24 05:12:28 mcalabre Exp $
@


4.20
log
@WCSLIB 4.20
@
text
@d3 2
a4 2
  WCSLIB 4.20 - an implementation of the FITS WCS standard.
  Copyright (C) 1995-2013, Mark Calabretta
d25 1
a25 1
  $Id: tprj1.c,v 4.19.1.1 2013/09/29 14:20:40 mcalabre Exp mcalabre $
d218 6
a223 6
  int    lat, lng, nFail = 0, stat1[361], stat2[361], status;
  register int j;
  double dlat, dlatmx, dlng, dlngmx, dr, drmax;
  double lat1, lat2[361], lng1[361], lng2[361];
  double r, theta;
  double x[361], x1[361], x2[361], y[361], y1[361], y2[361];
d260 1
d263 4
a266 2
        printf("                x =%20.15f     y =%20.15f  ERROR%3d\n",
          x[j], y[j], stat2[j]);
d304 6
a309 1
  theta = -180.0;
d311 10
a320 1
  drmax = 0.0;
d322 18
a339 26
  for (j = 1; j <= 12; j++) {
    x1[0] = r*cosd(theta);
    y1[0] = r*sind(theta);

    if ((status = prj->prjx2s(prj, 1, 1, 1, 1, x1, y1, lng1, &lat1, stat2))) {
      printf("   %3s(X2S):   x1 =%20.15f    y1 =%20.15f  ERROR%3d\n",
        pcode, x1[0], y1[0], status);

    } else if ((status = prj->prjs2x(prj, 1, 1, 1, 1, lng1, &lat1, x2, y2,
                                     stat1))) {
      printf("   %3s(S2X):   x1 =%20.15f    y1 =%20.15f\n",
        pcode, x1[0], y1[0]);
      printf("              lng =%20.15f   lat =%20.15f  ERROR%3d\n",
        lng1[0], lat1, status);

    } else {
      dr = sqrt((x2[0]-x1[0])*(x2[0]-x1[0]) + (y2[0]-y1[0])*(y2[0]-y1[0]));
      if (dr > drmax) drmax = dr;
      if (dr > tol) {
        nFail++;
        printf("        %3s:   x1 =%20.15f    y1 =%20.15f\n",
          pcode, x1[0], y1[0]);
        printf("              lng =%20.15f   lat =%20.15f\n",
          lng1[0], lat1);
        printf("               x2 =%20.15f    y2 =%20.15f\n",
          x2[0], y2[0]);
d343 1
a343 2
    r /= 10.0;
    theta += 15.0;
a344 2

  printf("             Maximum residual (ref):  dR%8.1e\n", drmax);
@


4.20.1.1
log
@WCSLIB 4.20 development branch.
@
text
@d25 1
a25 1
  $Id: tprj1.c,v 4.20 2013/12/18 05:42:50 mcalabre Exp $
@


4.20.1.2
log
@Test closure in the neighbourhood of the reference point on a grid rather
than a spiral so also to test the vector API of prjx2s().
@
text
@d25 1
a25 1
  $Id: tprj1.c,v 4.20.1.1 2013/12/18 05:46:56 mcalabre Exp mcalabre $
d218 6
a223 6
  int    lat, lng, nFail = 0, stat1[361], stat2[361], statr[25][25], status;
  register int i, j;
  double dlat, dlatmx, dlng, dlngmx, dr, drmax, dx, dy;
  double lat1, lat2[361], lng1[361], lng2[361], x[361], y[361];
  double latr[25][25], lngr[25][25], r, x1[25], x2[25][25], y1[25],
         y2[25][25];
d301 1
a301 6
  x1[12] = y1[12] = 0.0;
  for (j = 0; j < 12; j++) {
    x1[j] = -r;
    y1[j] = -r;
    x1[24-j] = r;
    y1[24-j] = r;
d303 1
a303 2
    r /= 10.0;
  }
d305 26
a330 26
  if ((status = prj->prjx2s(prj, 25, 25, 1, 1, x1, y1, lngr[0], latr[0],
                            statr[0]))) {
    printf("   %3s(X2S) ERROR: %s\n", pcode, prj_errmsg[status]);

  } else if ((status = prj->prjs2x(prj, 625, 0, 1, 1, lngr[0], latr[0],
                                   x2[0], y2[0], statr[0]))) {
    printf("   %3s(S2X) ERROR: %s\n", pcode, prj_errmsg[status]);

  } else {
    drmax = 0.0;
    for (i = 0; i < 25; i++) {
      for (j = 0; j < 25; j++) {
        dx = x2[i][j] - x1[j];
        dy = y2[i][j] - y1[i];
        dr = sqrt(dx*dx + dy*dy);

        if (dr > drmax) drmax = dr;
        if (dr > tol) {
          nFail++;
          printf("        %3s:   x1 =%20.15f    y1 =%20.15f\n",
            pcode, x1[j], y1[i]);
          printf("              lng =%20.15f   lat =%20.15f\n",
            lngr[i][j], latr[i][j]);
          printf("               x2 =%20.15f    y2 =%20.15f\n",
            x2[i][j], y2[i][j]);
        }
d334 2
a335 1
    printf("             Maximum residual (ref):  dR%8.1e\n", drmax);
d337 2
@


4.20.1.3
log
@Updated date in copyright notice.
@
text
@d4 1
a4 1
  Copyright (C) 1995-2014, Mark Calabretta
d25 1
a25 1
  $Id: tprj1.c,v 4.20.1.2 2014/03/21 06:13:38 mcalabre Exp mcalabre $
@


4.20.1.4
log
@In projex(), count out-of-bounds returns from prjx2s() as failures, and
report the corresponding values of lng2 and lat2.
@
text
@d25 1
a25 1
  $Id: tprj1.c,v 4.20.1.3 2014/03/21 06:26:03 mcalabre Exp mcalabre $
a259 1
        nFail++;
d262 2
a263 4
        printf("                x =%20.15f     y =%20.15f\n",
          x[j], y[j]);
        printf("             lng2 =%20.15f  lat2 =%20.15f  ERROR%3d\n",
          lng2[j], lat2[j], stat2[j]);
@


4.20.1.5
log
@Cosmetic tweak - make i vary fastest in i,j double loops, as per FITS images.
@
text
@d25 1
a25 1
  $Id: tprj1.c,v 4.20.1.4 2014/03/22 04:42:30 mcalabre Exp mcalabre $
d305 5
a309 5
  for (i = 0; i < 12; i++) {
    x1[i] = -r;
    y1[i] = -r;
    x1[24-i] = r;
    y1[24-i] = r;
d324 4
a327 4
    for (j = 0; j < 25; j++) {
      for (i = 0; i < 25; i++) {
        dx = x2[j][i] - x1[i];
        dy = y2[j][i] - y1[j];
d334 1
a334 1
            pcode, x1[i], y1[j]);
d336 1
a336 1
            lngr[j][i], latr[j][i]);
d338 1
a338 1
            x2[j][i], y2[j][i]);
@


4.19
log
@WCSLIB 4.19
@
text
@d3 1
a3 1
  WCSLIB 4.19 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: tprj1.c,v 4.18.1.1 2013/07/13 10:02:38 mcalabre Exp mcalabre $
@


4.19.1.1
log
@WCSLIB 4.19 development branch.
@
text
@d25 1
a25 1
  $Id: tprj1.c,v 4.19 2013/09/29 14:17:52 mcalabre Exp $
@


4.18
log
@WCSLIB 4.18
@
text
@d3 1
a3 1
  WCSLIB 4.18 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: tprj1.c,v 4.17.1.2 2013/07/12 04:08:06 mcalabre Exp mcalabre $
@


4.18.1.1
log
@WCSLIB 4.18 development branch.
@
text
@d25 1
a25 1
  $Id: tprj1.c,v 4.18 2013/07/13 10:00:05 mcalabre Exp $
@


4.17
log
@WCSLIB 4.17
@
text
@d3 1
a3 1
  WCSLIB 4.17 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: tprj1.c,v 4.16.1.2 2013/01/29 05:10:40 cal103 Exp cal103 $
d179 3
d299 1
a299 1
  /* Test closure at a point close to the reference point. */
@


4.17.1.1
log
@WCSLIB 4.17 development branch.
@
text
@d25 1
a25 1
  $Id: tprj1.c,v 4.17 2013/01/29 05:29:21 cal103 Exp $
@


4.17.1.2
log
@Added the XPH projection.
@
text
@d25 1
a25 1
  $Id: tprj1.c,v 4.17.1.1 2013/01/29 05:32:33 cal103 Exp cal103 $
a178 3
  /* XPH: HEALPix polar, aka "butterfly" projection. */
  nFail += projex("XPH", &prj, 90, -90, tol);

d296 1
a296 1
  /* Test closure in the neighbourhood of the reference point. */
@


4.16
log
@WCSLIB 4.16
@
text
@d3 2
a4 2
  WCSLIB 4.16 - an implementation of the FITS WCS standard.
  Copyright (C) 1995-2012, Mark Calabretta
d25 1
a25 1
  $Id: tprj1.c,v 4.15.1.1 2012/09/26 14:27:52 cal103 Exp cal103 $
@


4.16.1.1
log
@WCSLIB 4.16 development branch.
@
text
@d25 1
a25 1
  $Id: tprj1.c,v 4.16 2012/11/07 04:42:45 cal103 Exp $
@


4.16.1.2
log
@Updated date in copyright notice.
@
text
@d4 1
a4 1
  Copyright (C) 1995-2013, Mark Calabretta
d25 1
a25 1
  $Id: tprj1.c,v 4.16.1.1 2012/11/07 04:45:57 cal103 Exp cal103 $
@


4.15
log
@WCSLIB 4.15
@
text
@d3 1
a3 1
  WCSLIB 4.15 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: tprj1.c,v 4.14.1.1 2012/07/13 10:04:50 cal103 Exp cal103 $
@


4.15.1.1
log
@WCSLIB 4.15 development branch.
@
text
@d25 1
a25 1
  $Id: tprj1.c,v 4.15 2012/09/26 14:26:06 cal103 Exp $
@


4.14
log
@WCSLIB 4.14
@
text
@d3 1
a3 1
  WCSLIB 4.14 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: tprj1.c,v 4.13.1.2 2012/07/13 03:37:00 cal103 Exp cal103 $
@


4.14.1.1
log
@WCSLIB 4.14 development branch.
@
text
@d25 1
a25 1
  $Id: tprj1.c,v 4.14 2012/07/13 10:02:32 cal103 Exp $
@


4.13
log
@WCSLIB 4.13
@
text
@d3 1
a3 1
  WCSLIB 4.13 - an implementation of the FITS WCS standard.
d19 1
a19 1
  along with WCSLIB.  If not, see <http://www.gnu.org/licenses/>.
d21 5
a25 11
  Correspondence concerning WCSLIB may be directed to:
    Internet email: mcalabre@@atnf.csiro.au
    Postal address: Dr. Mark Calabretta
                    Australia Telescope National Facility, CSIRO
                    PO Box 76
                    Epping NSW 1710
                    AUSTRALIA

  Author: Mark Calabretta, Australia Telescope National Facility
  http://www.atnf.csiro.au/~mcalabre/index.html
  $Id: tprj1.c,v 4.12.1.1 2012/02/29 07:59:11 cal103 Exp cal103 $
@


4.13.1.1
log
@WCSLIB 4.13 development branch.
@
text
@d31 1
a31 1
  $Id: tprj1.c,v 4.13 2012/03/14 07:39:30 cal103 Exp $
@


4.13.1.2
log
@Changed contact details.
@
text
@d19 1
a19 1
  along with WCSLIB.  If not, see http://www.gnu.org/licenses.
d21 11
a31 5
  Direct correspondence concerning WCSLIB to mark@@calabretta.id.au

  Author: Mark Calabretta, Australia Telescope National Facility, CSIRO.
  http://www.atnf.csiro.au/people/Mark.Calabretta
  $Id: tprj1.c,v 4.13.1.1 2012/03/14 07:40:38 cal103 Exp cal103 $
@


4.12
log
@WCSLIB 4.12
@
text
@d3 1
a3 1
  WCSLIB 4.12 - an implementation of the FITS WCS standard.
d31 1
a31 1
  $Id: tprj1.c,v 4.11.1.1 2012/02/20 23:31:13 cal103 Exp cal103 $
@


4.12.1.1
log
@WCSLIB 4.12 development branch.
@
text
@d31 1
a31 1
  $Id: tprj1.c,v 4.12 2012/02/29 07:57:57 cal103 Exp $
@


4.11
log
@WCSLIB 4.11
@
text
@d3 1
a3 1
  WCSLIB 4.11 - an implementation of the FITS WCS standard.
d31 1
a31 1
  $Id: tprj1.c,v 4.10.1.1 2012/02/05 23:42:47 cal103 Exp cal103 $
@


4.11.1.1
log
@WCSLIB 4.11 development branch.
@
text
@d31 1
a31 1
  $Id: tprj1.c,v 4.11 2012/02/20 23:30:02 cal103 Exp $
@


4.10
log
@WCSLIB 4.10
@
text
@d3 1
a3 1
  WCSLIB 4.10 - an implementation of the FITS WCS standard.
d31 1
a31 1
  $Id: tprj1.c,v 4.9.1.1 2012/01/24 05:41:46 cal103 Exp cal103 $
@


4.10.1.1
log
@WCSLIB 4.10 development branch.
@
text
@d31 1
a31 1
  $Id: tprj1.c,v 4.10 2012/02/05 23:41:44 cal103 Exp $
@


4.9
log
@WCSLIB 4.9
@
text
@d3 1
a3 1
  WCSLIB 4.9 - an implementation of the FITS WCS standard.
d31 1
a31 1
  $Id: tprj1.c,v 4.8.1.2 2012/01/24 05:23:30 cal103 Exp cal103 $
@


4.9.1.1
log
@WCSLIB 4.9 development branch.
@
text
@d31 1
a31 1
  $Id: tprj1.c,v 4.9 2012/01/24 05:40:29 cal103 Exp $
@


4.8
log
@WCSLIB 4.8
@
text
@d3 2
a4 2
  WCSLIB 4.8 - an implementation of the FITS WCS standard.
  Copyright (C) 1995-2011, Mark Calabretta
d31 1
a31 1
  $Id: tprj1.c,v 4.7.1.2 2011/08/12 04:50:57 cal103 Exp cal103 $
@


4.8.1.1
log
@WCSLIB 4.8 development branch.
@
text
@d31 1
a31 1
  $Id: tprj1.c,v 4.8 2011/08/15 08:05:54 cal103 Exp $
@


4.8.1.2
log
@Updated date in copyright notice.
@
text
@d4 1
a4 1
  Copyright (C) 1995-2012, Mark Calabretta
d31 1
a31 1
  $Id: tprj1.c,v 4.8.1.1 2011/08/15 08:07:06 cal103 Exp cal103 $
@


4.7
log
@WCSLIB 4.7
@
text
@d3 1
a3 1
  WCSLIB 4.7 - an implementation of the FITS WCS standard.
d31 1
a31 1
  $Id: tprj1.c,v 4.6.1.2 2011/01/14 06:33:44 cal103 Exp cal103 $
d46 2
d52 1
a52 2
  void projex();
  int  status;
d75 1
a75 1
  projex("AZP", &prj, 90, 5, tol);
d81 1
a81 1
  projex("SZP", &prj, 90, -90, tol);
d84 1
a84 1
  projex("TAN", &prj, 90, 5, tol);
d87 1
a87 1
  projex("STG", &prj, 90, -85, tol);
d92 1
a92 1
  projex("SIN", &prj, 90, 45, tol);
d95 1
a95 1
  projex("ARC", &prj, 90, -90, tol);
d108 1
a108 1
  projex("ZPN", &prj, 90, 10, tol);
d111 1
a111 1
  projex("ZEA", &prj, 90, -85, tol);
d115 1
a115 1
  projex("AIR", &prj, 90, -85, tol);
d120 1
a120 1
  projex("CYP", &prj, 90, -90, tol);
d124 1
a124 1
  projex("CEA", &prj, 90, -90, tol);
d127 1
a127 1
  projex("CAR", &prj, 90, -90, tol);
d130 1
a130 1
  projex("MER", &prj, 85, -85, tol);
d133 1
a133 1
  projex("SFL", &prj, 90, -90, tol);
d136 1
a136 1
  projex("PAR", &prj, 90, -90, tol);
d139 1
a139 1
  projex("MOL", &prj, 90, -90, tol);
d142 1
a142 1
  projex("AIT", &prj, 90, -90, tol);
d147 1
a147 1
  projex("COP", &prj, 90, -25, tol);
d152 1
a152 1
  projex("COE", &prj, 90, -90, tol);
d157 1
a157 1
  projex("COD", &prj, 90, -90, tol);
d162 1
a162 1
  projex("COO", &prj, 85, -90, tol);
d166 1
a166 1
  projex("BON", &prj, 90, -90, tol);
d169 1
a169 1
  projex("PCO", &prj, 90, -90, tol);
d172 1
a172 1
  projex("TSC", &prj, 90, -90, tol);
d175 1
a175 1
  projex("CSC", &prj, 90, -90, 4.0e-2);
d178 1
a178 1
  projex("QSC", &prj, 90, -90, tol);
d183 1
a183 1
  projex("HPX", &prj, 90, -90, tol);
d185 9
a193 1
  return 0;
d198 1
a198 1
*   PROJEX exercises the spherical projection routines.
d208 3
d213 6
a218 6
void projex(pcode, prj, north, south, tol)

char   pcode[4];
int    north, south;
double tol;
struct prjprm *prj;
d221 1
a221 1
  int    lat, lng, stat1[361], stat2[361], status;
d235 1
a235 1
  printf("Testing %s; latitudes%3d to%4d, reporting tolerance%8.1E deg.\n",
d277 1
d286 1
d298 1
a298 1
  printf("             Maximum residual (sky): lng%10.3E   lat%10.3E\n",
d327 1
d341 1
a341 1
  printf("             Maximum residual (ref):  dR%10.3E\n", drmax);
d345 1
a345 1
  return;
@


4.7.1.1
log
@WCSLIB 4.7 development branch.
@
text
@d31 1
a31 1
  $Id: tprj1.c,v 4.7 2011/02/07 07:03:42 cal103 Exp $
@


4.7.1.2
log
@Report PASS/FAIL and return the number of failures.
@
text
@d31 1
a31 1
  $Id: tprj1.c,v 4.7.1.1 2011/02/07 07:04:23 cal103 Exp cal103 $
a45 2
int projex(char pcode[4], struct prjprm *prj, int north, int south,
           double tol);
d50 2
a51 1
  int  nFail = 0, status;
d74 1
a74 1
  nFail += projex("AZP", &prj, 90, 5, tol);
d80 1
a80 1
  nFail += projex("SZP", &prj, 90, -90, tol);
d83 1
a83 1
  nFail += projex("TAN", &prj, 90, 5, tol);
d86 1
a86 1
  nFail += projex("STG", &prj, 90, -85, tol);
d91 1
a91 1
  nFail += projex("SIN", &prj, 90, 45, tol);
d94 1
a94 1
  nFail += projex("ARC", &prj, 90, -90, tol);
d107 1
a107 1
  nFail += projex("ZPN", &prj, 90, 10, tol);
d110 1
a110 1
  nFail += projex("ZEA", &prj, 90, -85, tol);
d114 1
a114 1
  nFail += projex("AIR", &prj, 90, -85, tol);
d119 1
a119 1
  nFail += projex("CYP", &prj, 90, -90, tol);
d123 1
a123 1
  nFail += projex("CEA", &prj, 90, -90, tol);
d126 1
a126 1
  nFail += projex("CAR", &prj, 90, -90, tol);
d129 1
a129 1
  nFail += projex("MER", &prj, 85, -85, tol);
d132 1
a132 1
  nFail += projex("SFL", &prj, 90, -90, tol);
d135 1
a135 1
  nFail += projex("PAR", &prj, 90, -90, tol);
d138 1
a138 1
  nFail += projex("MOL", &prj, 90, -90, tol);
d141 1
a141 1
  nFail += projex("AIT", &prj, 90, -90, tol);
d146 1
a146 1
  nFail += projex("COP", &prj, 90, -25, tol);
d151 1
a151 1
  nFail += projex("COE", &prj, 90, -90, tol);
d156 1
a156 1
  nFail += projex("COD", &prj, 90, -90, tol);
d161 1
a161 1
  nFail += projex("COO", &prj, 85, -90, tol);
d165 1
a165 1
  nFail += projex("BON", &prj, 90, -90, tol);
d168 1
a168 1
  nFail += projex("PCO", &prj, 90, -90, tol);
d171 1
a171 1
  nFail += projex("TSC", &prj, 90, -90, tol);
d174 1
a174 1
  nFail += projex("CSC", &prj, 90, -90, 4.0e-2);
d177 1
a177 1
  nFail += projex("QSC", &prj, 90, -90, tol);
d182 1
a182 1
  nFail += projex("HPX", &prj, 90, -90, tol);
d184 1
a184 9

  if (nFail) {
    printf("\nFAIL: %d closure residuals exceed reporting tolerance.\n",
      nFail);
  } else {
    printf("\nPASS: All closure residuals are within reporting tolerance.\n");
  }

  return nFail;
d189 1
a189 1
*   projex() exercises the spherical projection routines.
a198 3
*
*   Function return value:
*                int      Number of results exceeding reporting tolerance.
d201 6
a206 6
int projex(
  char pcode[4],
  struct prjprm *prj,
  int north,
  int south,
  double tol)
d209 1
a209 1
  int    lat, lng, nFail = 0, stat1[361], stat2[361], status;
d223 1
a223 1
  printf("Testing %s; latitudes%3d to%4d, reporting tolerance%8.1e deg.\n",
a264 1
        nFail++;
a272 1
          nFail++;
d284 1
a284 1
  printf("             Maximum residual (sky): lng%8.1e  lat%8.1e\n",
a312 1
        nFail++;
d326 1
a326 1
  printf("             Maximum residual (ref):  dR%8.1e\n", drmax);
d330 1
a330 1
  return nFail;
@


4.6
log
@WCSLIB 4.6
@
text
@d3 2
a4 2
  WCSLIB 4.6 - an implementation of the FITS WCS standard.
  Copyright (C) 1995-2010, Mark Calabretta
d31 1
a31 1
  $Id: tprj1.c,v 4.5.1.1 2010/07/16 07:05:32 cal103 Exp cal103 $
@


4.6.1.1
log
@WCSLIB 4.6 development branch.
@
text
@d31 1
a31 1
  $Id: tprj1.c,v 4.6 2010/11/16 06:15:31 cal103 Exp $
@


4.6.1.2
log
@Updated date in copyright notice.
@
text
@d4 1
a4 1
  Copyright (C) 1995-2011, Mark Calabretta
d31 1
a31 1
  $Id: tprj1.c,v 4.6.1.1 2010/11/16 06:16:19 cal103 Exp cal103 $
@


4.5
log
@WCSLIB 4.5
@
text
@d3 1
a3 1
  WCSLIB 4.5 - an implementation of the FITS WCS standard.
d31 1
a31 1
  $Id: tprj1.c,v 4.4.1.2 2010/01/19 03:44:00 cal103 Exp cal103 $
@


4.5.1.1
log
@WCSLIB 4.5 development branch.
@
text
@d31 1
a31 1
  $Id: tprj1.c,v 4.5 2010/07/16 07:01:26 cal103 Exp $
@


4.4
log
@WCSLIB 4.4
@
text
@d3 2
a4 2
  WCSLIB 4.4 - an implementation of the FITS WCS standard.
  Copyright (C) 1995-2009, Mark Calabretta
d31 1
a31 1
  $Id: tprj1.c,v 4.3.1.2 2009/07/22 06:37:43 cal103 Exp cal103 $
@


4.4.1.1
log
@WCSLIB 4.4 development branch.
@
text
@d31 1
a31 1
  $Id: tprj1.c,v 4.4 2009/08/06 07:45:31 cal103 Exp $
@


4.4.1.2
log
@Updated date in copyright notice.
@
text
@d4 1
a4 1
  Copyright (C) 1995-2010, Mark Calabretta
d31 1
a31 1
  $Id: tprj1.c,v 4.4.1.1 2009/08/10 08:54:26 cal103 Exp cal103 $
@


4.3
log
@WCSLIB 4.3
@
text
@d3 2
a4 2
    WCSLIB 4.3 - an implementation of the FITS WCS standard.
    Copyright (C) 1995-2007, Mark Calabretta
d6 1
a6 1
    This file is part of WCSLIB.
d8 24
a31 24
    WCSLIB is free software: you can redistribute it and/or modify it under
    the terms of the GNU Lesser General Public License as published by the
    Free Software Foundation, either version 3 of the License, or (at your
    option) any later version.

    WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY
    WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
    FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for
    more details.

    You should have received a copy of the GNU Lesser General Public License
    along with WCSLIB.  If not, see <http://www.gnu.org/licenses/>.

    Correspondence concerning WCSLIB may be directed to:
       Internet email: mcalabre@@atnf.csiro.au
       Postal address: Dr. Mark Calabretta
                       Australia Telescope National Facility, CSIRO
                       PO Box 76
                       Epping NSW 1710
                       AUSTRALIA

    Author: Mark Calabretta, Australia Telescope National Facility
    http://www.atnf.csiro.au/~mcalabre/index.html
    $Id: tprj1.c,v 4.2.1.4 2007/12/03 05:12:59 cal103 Exp $
d34 1
a34 1
*   tproj1 tests spherical projections for closure.
d50 4
a53 4
   void projex();
   int  status;
   const double tol = 1.0e-9;
   struct prjprm prj;
d56 3
a58 3
   printf(
      "Testing closure of WCSLIB spherical projection routines (tprj1.c)\n"
      "-----------------------------------------------------------------\n");
d60 5
a64 5
   /* List status return messages. */
   printf("\nList of prj status return values:\n");
   for (status = 1; status <= 4; status++) {
      printf("%4d: %s.\n", status, prj_errmsg[status]);
   }
d66 1
a66 1
   printf("\n");
d69 1
a69 1
   prjini(&prj);
d71 4
a74 4
   /* AZP: zenithal/azimuthal perspective. */
   prj.pv[1] =   0.5;
   prj.pv[2] =  30.0;
   projex("AZP", &prj, 90, 5, tol);
d76 5
a80 5
   /* SZP: slant zenithal perspective. */
   prj.pv[1] =   0.5;
   prj.pv[2] = 210.0;
   prj.pv[3] =  60.0;
   projex("SZP", &prj, 90, -90, tol);
d82 2
a83 2
   /* TAN: gnomonic. */
   projex("TAN", &prj, 90, 5, tol);
d85 2
a86 2
   /* STG: stereographic. */
   projex("STG", &prj, 90, -85, tol);
d88 4
a91 4
   /* SIN: orthographic/synthesis. */
   prj.pv[1] = -0.3;
   prj.pv[2] =  0.5;
   projex("SIN", &prj, 90, 45, tol);
d93 2
a94 2
   /* ARC: zenithal/azimuthal equidistant. */
   projex("ARC", &prj, 90, -90, tol);
d96 12
a107 12
   /* ZPN: zenithal/azimuthal polynomial. */
   prj.pv[0] =  0.00000;
   prj.pv[1] =  0.95000;
   prj.pv[2] = -0.02500;
   prj.pv[3] = -0.15833;
   prj.pv[4] =  0.00208;
   prj.pv[5] =  0.00792;
   prj.pv[6] = -0.00007;
   prj.pv[7] = -0.00019;
   prj.pv[8] =  0.00000;
   prj.pv[9] =  0.00000;
   projex("ZPN", &prj, 90, 10, tol);
d109 2
a110 2
   /* ZEA: zenithal/azimuthal equal area. */
   projex("ZEA", &prj, 90, -85, tol);
d112 3
a114 3
   /* AIR: Airy's zenithal projection. */
   prj.pv[1] = 45.0;
   projex("AIR", &prj, 90, -85, tol);
d116 4
a119 4
   /* CYP: cylindrical perspective. */
   prj.pv[1] = 3.0;
   prj.pv[2] = 0.8;
   projex("CYP", &prj, 90, -90, tol);
d121 3
a123 3
   /* CEA: cylindrical equal area. */
   prj.pv[1] = 0.75;
   projex("CEA", &prj, 90, -90, tol);
d125 2
a126 2
   /* CAR: plate carree. */
   projex("CAR", &prj, 90, -90, tol);
d128 2
a129 2
   /* MER: Mercator's. */
   projex("MER", &prj, 85, -85, tol);
d131 2
a132 2
   /* SFL: Sanson-Flamsteed. */
   projex("SFL", &prj, 90, -90, tol);
d134 2
a135 2
   /* PAR: parabolic. */
   projex("PAR", &prj, 90, -90, tol);
d137 2
a138 2
   /* MOL: Mollweide's projection. */
   projex("MOL", &prj, 90, -90, tol);
d140 2
a141 2
   /* AIT: Hammer-Aitoff. */
   projex("AIT", &prj, 90, -90, tol);
d143 4
a146 4
   /* COP: conic perspective. */
   prj.pv[1] =  60.0;
   prj.pv[2] =  15.0;
   projex("COP", &prj, 90, -25, tol);
d148 4
a151 4
   /* COE: conic equal area. */
   prj.pv[1] =  60.0;
   prj.pv[2] = -15.0;
   projex("COE", &prj, 90, -90, tol);
d153 4
a156 4
   /* COD: conic equidistant. */
   prj.pv[1] = -60.0;
   prj.pv[2] =  15.0;
   projex("COD", &prj, 90, -90, tol);
d158 4
a161 4
   /* COO: conic orthomorphic. */
   prj.pv[1] = -60.0;
   prj.pv[2] = -15.0;
   projex("COO", &prj, 85, -90, tol);
d163 3
a165 3
   /* BON: Bonne's projection. */
   prj.pv[1] = 30.0;
   projex("BON", &prj, 90, -90, tol);
d167 2
a168 2
   /* PCO: polyconic. */
   projex("PCO", &prj, 90, -90, tol);
d170 2
a171 2
   /* TSC: tangential spherical cube. */
   projex("TSC", &prj, 90, -90, tol);
d173 2
a174 2
   /* CSC: COBE quadrilateralized spherical cube. */
   projex("CSC", &prj, 90, -90, 4.0e-2);
d176 2
a177 2
   /* QSC: quadrilateralized spherical cube. */
   projex("QSC", &prj, 90, -90, tol);
d179 4
a182 4
   /* HPX: HEALPix projection. */
   prj.pv[1] = 4.0;
   prj.pv[2] = 3.0;
   projex("HPX", &prj, 90, -90, tol);
d184 1
a184 1
   return 0;
d209 47
a255 31
   int    lat, lng, stat1[361], stat2[361], status;
   register int j;
   double dlat, dlatmx, dlng, dlngmx, dr, drmax;
   double lat1, lat2[361], lng1[361], lng2[361];
   double r, theta;
   double x[361], x1[361], x2[361], y[361], y1[361], y2[361];


   strcpy(prj->code, pcode);

   /* Uncomment the next line to test alternative initializations of */
   /* projection parameters.                                         */
   /* prj->r0 = R2D; */

   printf("Testing %s; latitudes%3d to%4d, reporting tolerance%8.1E deg.\n",
      prj->code, north, south, tol);

   dlngmx = 0.0;
   dlatmx = 0.0;

   prjset(prj);
   for (lat = north; lat >= south; lat--) {
      lat1 = (double)lat;

      for (j = 0, lng = -180; lng <= 180; lng++, j++) {
         lng1[j] = (double)lng;
      }

      if (prj->prjs2x(prj, 361, 1, 1, 1, lng1, &lat1, x, y, stat1) == 1) {
         printf("   %3s(S2X) ERROR 1: %s\n", pcode, prj_errmsg[1]);
         continue;
d258 22
a279 39
      if (prj->prjx2s(prj, 361, 0, 1, 1, x, y, lng2, lat2, stat2) == 1) {
         printf("   %3s(X2S) ERROR 1: %s\n", pcode, prj_errmsg[1]);
         continue;
      }

      for (j = 0; j < 361; j++) {
         if (stat1[j]) continue;

         if (stat2[j]) {
            printf("   %3s(X2S): lng1 =%20.15f  lat1 =%20.15f\n",
               pcode, lng1[j], lat1);
            printf("                x =%20.15f     y =%20.15f  ERROR%3d\n",
               x[j], y[j], stat2[j]);
            continue;
         }

         dlng = fabs(lng2[j] - lng1[j]);
         if (dlng > 180.0) dlng = fabs(dlng-360.0);
         if (abs(lat) != 90 && dlng > dlngmx) dlngmx = dlng;
         dlat = fabs(lat2[j] - lat1);
         if (dlat > dlatmx) dlatmx = dlat;

         if (dlat > tol) {
            printf("        %3s: lng1 =%20.15f  lat1 =%20.15f\n",
               pcode, lng1[j], lat1);
            printf("                x =%20.15f     y =%20.15f\n",
               x[j], y[j]);
            printf("             lng2 =%20.15f  lat2 =%20.15f\n",
               lng2[j], lat2[j]);
         } else if (abs(lat) != 90) {
            if (dlng > tol) {
               printf("        %3s: lng1 =%20.15f  lat1 =%20.15f\n",
                  pcode, lng1[j], lat1);
               printf("                x =%20.15f     y =%20.15f\n",
                  x[j], y[j]);
               printf("             lng2 =%20.15f  lat2 =%20.15f\n",
                  lng2[j], lat2[j]);
            }
         }
d281 2
a282 1
   }
d284 2
a285 2
   printf("             Maximum residual (sky): lng%10.3E   lat%10.3E\n",
      dlngmx, dlatmx);
d288 31
a318 33
   /* Test closure at a point close to the reference point. */
   r = 1.0;
   theta = -180.0;

   drmax = 0.0;

   for (j = 1; j <= 12; j++) {
      x1[0] = r*cosd(theta);
      y1[0] = r*sind(theta);

      if ((status = prj->prjx2s(prj, 1, 1, 1, 1, x1, y1, lng1, &lat1,
                                stat2))) {
         printf("   %3s(X2S):   x1 =%20.15f    y1 =%20.15f  ERROR%3d\n",
            pcode, x1[0], y1[0], status);

      } else if ((status = prj->prjs2x(prj, 1, 1, 1, 1, lng1, &lat1, x2, y2,
                                       stat1))) {
         printf("   %3s(S2X):   x1 =%20.15f    y1 =%20.15f\n",
            pcode, x1[0], y1[0]);
         printf("              lng =%20.15f   lat =%20.15f  ERROR%3d\n",
            lng1[0], lat1, status);

      } else {
         dr = sqrt((x2[0]-x1[0])*(x2[0]-x1[0]) + (y2[0]-y1[0])*(y2[0]-y1[0]));
         if (dr > drmax) drmax = dr;
         if (dr > tol) {
            printf("        %3s:   x1 =%20.15f    y1 =%20.15f\n",
               pcode, x1[0], y1[0]);
            printf("              lng =%20.15f   lat =%20.15f\n",
               lng1[0], lat1);
            printf("               x2 =%20.15f    y2 =%20.15f\n",
               x2[0], y2[0]);
         }
d320 1
d322 3
a324 3
      r /= 10.0;
      theta += 15.0;
   }
d326 1
a326 1
   printf("             Maximum residual (ref):  dR%10.3E\n", drmax);
d328 1
a328 1
   prjini(prj);
d330 1
a330 1
   return;
@


4.3.1.1
log
@WCSLIB 4.3 development branch.
@
text
@d3 2
a4 2
    WCSLIB 4.4 - an implementation of the FITS WCS standard.
    Copyright (C) 1995-2008, Mark Calabretta
d31 1
a31 1
    $Id: tprj1.c,v 4.3 2007/12/27 05:35:51 cal103 Exp cal103 $
@


4.3.1.2
log
@Changed indentation.
@
text
@d3 2
a4 2
  WCSLIB 4.4 - an implementation of the FITS WCS standard.
  Copyright (C) 1995-2009, Mark Calabretta
d6 1
a6 1
  This file is part of WCSLIB.
d8 24
a31 24
  WCSLIB is free software: you can redistribute it and/or modify it under the
  terms of the GNU Lesser General Public License as published by the Free
  Software Foundation, either version 3 of the License, or (at your option)
  any later version.

  WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY
  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for
  more details.

  You should have received a copy of the GNU Lesser General Public License
  along with WCSLIB.  If not, see <http://www.gnu.org/licenses/>.

  Correspondence concerning WCSLIB may be directed to:
    Internet email: mcalabre@@atnf.csiro.au
    Postal address: Dr. Mark Calabretta
                    Australia Telescope National Facility, CSIRO
                    PO Box 76
                    Epping NSW 1710
                    AUSTRALIA

  Author: Mark Calabretta, Australia Telescope National Facility
  http://www.atnf.csiro.au/~mcalabre/index.html
  $Id: tprj1.c,v 4.3.1.1 2007/12/27 13:24:32 cal103 Exp cal103 $
d34 1
a34 1
* tproj1 tests spherical projections for closure.
d50 4
a53 4
  void projex();
  int  status;
  const double tol = 1.0e-9;
  struct prjprm prj;
d56 3
a58 3
  printf(
    "Testing closure of WCSLIB spherical projection routines (tprj1.c)\n"
    "-----------------------------------------------------------------\n");
d60 5
a64 5
  /* List status return messages. */
  printf("\nList of prj status return values:\n");
  for (status = 1; status <= 4; status++) {
    printf("%4d: %s.\n", status, prj_errmsg[status]);
  }
d66 1
a66 1
  printf("\n");
d69 1
a69 1
  prjini(&prj);
d71 4
a74 4
  /* AZP: zenithal/azimuthal perspective. */
  prj.pv[1] =   0.5;
  prj.pv[2] =  30.0;
  projex("AZP", &prj, 90, 5, tol);
d76 5
a80 5
  /* SZP: slant zenithal perspective. */
  prj.pv[1] =   0.5;
  prj.pv[2] = 210.0;
  prj.pv[3] =  60.0;
  projex("SZP", &prj, 90, -90, tol);
d82 2
a83 2
  /* TAN: gnomonic. */
  projex("TAN", &prj, 90, 5, tol);
d85 2
a86 2
  /* STG: stereographic. */
  projex("STG", &prj, 90, -85, tol);
d88 4
a91 4
  /* SIN: orthographic/synthesis. */
  prj.pv[1] = -0.3;
  prj.pv[2] =  0.5;
  projex("SIN", &prj, 90, 45, tol);
d93 2
a94 2
  /* ARC: zenithal/azimuthal equidistant. */
  projex("ARC", &prj, 90, -90, tol);
d96 12
a107 12
  /* ZPN: zenithal/azimuthal polynomial. */
  prj.pv[0] =  0.00000;
  prj.pv[1] =  0.95000;
  prj.pv[2] = -0.02500;
  prj.pv[3] = -0.15833;
  prj.pv[4] =  0.00208;
  prj.pv[5] =  0.00792;
  prj.pv[6] = -0.00007;
  prj.pv[7] = -0.00019;
  prj.pv[8] =  0.00000;
  prj.pv[9] =  0.00000;
  projex("ZPN", &prj, 90, 10, tol);
d109 2
a110 2
  /* ZEA: zenithal/azimuthal equal area. */
  projex("ZEA", &prj, 90, -85, tol);
d112 3
a114 3
  /* AIR: Airy's zenithal projection. */
  prj.pv[1] = 45.0;
  projex("AIR", &prj, 90, -85, tol);
d116 4
a119 4
  /* CYP: cylindrical perspective. */
  prj.pv[1] = 3.0;
  prj.pv[2] = 0.8;
  projex("CYP", &prj, 90, -90, tol);
d121 3
a123 3
  /* CEA: cylindrical equal area. */
  prj.pv[1] = 0.75;
  projex("CEA", &prj, 90, -90, tol);
d125 2
a126 2
  /* CAR: plate carree. */
  projex("CAR", &prj, 90, -90, tol);
d128 2
a129 2
  /* MER: Mercator's. */
  projex("MER", &prj, 85, -85, tol);
d131 2
a132 2
  /* SFL: Sanson-Flamsteed. */
  projex("SFL", &prj, 90, -90, tol);
d134 2
a135 2
  /* PAR: parabolic. */
  projex("PAR", &prj, 90, -90, tol);
d137 2
a138 2
  /* MOL: Mollweide's projection. */
  projex("MOL", &prj, 90, -90, tol);
d140 2
a141 2
  /* AIT: Hammer-Aitoff. */
  projex("AIT", &prj, 90, -90, tol);
d143 4
a146 4
  /* COP: conic perspective. */
  prj.pv[1] =  60.0;
  prj.pv[2] =  15.0;
  projex("COP", &prj, 90, -25, tol);
d148 4
a151 4
  /* COE: conic equal area. */
  prj.pv[1] =  60.0;
  prj.pv[2] = -15.0;
  projex("COE", &prj, 90, -90, tol);
d153 4
a156 4
  /* COD: conic equidistant. */
  prj.pv[1] = -60.0;
  prj.pv[2] =  15.0;
  projex("COD", &prj, 90, -90, tol);
d158 4
a161 4
  /* COO: conic orthomorphic. */
  prj.pv[1] = -60.0;
  prj.pv[2] = -15.0;
  projex("COO", &prj, 85, -90, tol);
d163 3
a165 3
  /* BON: Bonne's projection. */
  prj.pv[1] = 30.0;
  projex("BON", &prj, 90, -90, tol);
d167 2
a168 2
  /* PCO: polyconic. */
  projex("PCO", &prj, 90, -90, tol);
d170 2
a171 2
  /* TSC: tangential spherical cube. */
  projex("TSC", &prj, 90, -90, tol);
d173 2
a174 2
  /* CSC: COBE quadrilateralized spherical cube. */
  projex("CSC", &prj, 90, -90, 4.0e-2);
d176 2
a177 2
  /* QSC: quadrilateralized spherical cube. */
  projex("QSC", &prj, 90, -90, tol);
d179 4
a182 4
  /* HPX: HEALPix projection. */
  prj.pv[1] = 4.0;
  prj.pv[2] = 3.0;
  projex("HPX", &prj, 90, -90, tol);
d184 1
a184 1
  return 0;
d209 31
a239 47
  int    lat, lng, stat1[361], stat2[361], status;
  register int j;
  double dlat, dlatmx, dlng, dlngmx, dr, drmax;
  double lat1, lat2[361], lng1[361], lng2[361];
  double r, theta;
  double x[361], x1[361], x2[361], y[361], y1[361], y2[361];


  strcpy(prj->code, pcode);

  /* Uncomment the next line to test alternative initializations of */
  /* projection parameters.                                         */
  /* prj->r0 = R2D; */

  printf("Testing %s; latitudes%3d to%4d, reporting tolerance%8.1E deg.\n",
    prj->code, north, south, tol);

  dlngmx = 0.0;
  dlatmx = 0.0;

  prjset(prj);
  for (lat = north; lat >= south; lat--) {
    lat1 = (double)lat;

    for (j = 0, lng = -180; lng <= 180; lng++, j++) {
      lng1[j] = (double)lng;
    }

    if (prj->prjs2x(prj, 361, 1, 1, 1, lng1, &lat1, x, y, stat1) == 1) {
      printf("   %3s(S2X) ERROR 1: %s\n", pcode, prj_errmsg[1]);
      continue;
    }

    if (prj->prjx2s(prj, 361, 0, 1, 1, x, y, lng2, lat2, stat2) == 1) {
      printf("   %3s(X2S) ERROR 1: %s\n", pcode, prj_errmsg[1]);
      continue;
    }

    for (j = 0; j < 361; j++) {
      if (stat1[j]) continue;

      if (stat2[j]) {
        printf("   %3s(X2S): lng1 =%20.15f  lat1 =%20.15f\n",
          pcode, lng1[j], lat1);
        printf("                x =%20.15f     y =%20.15f  ERROR%3d\n",
          x[j], y[j], stat2[j]);
        continue;
d242 39
a280 22
      dlng = fabs(lng2[j] - lng1[j]);
      if (dlng > 180.0) dlng = fabs(dlng-360.0);
      if (abs(lat) != 90 && dlng > dlngmx) dlngmx = dlng;
      dlat = fabs(lat2[j] - lat1);
      if (dlat > dlatmx) dlatmx = dlat;

      if (dlat > tol) {
        printf("        %3s: lng1 =%20.15f  lat1 =%20.15f\n",
          pcode, lng1[j], lat1);
        printf("                x =%20.15f     y =%20.15f\n",
          x[j], y[j]);
        printf("             lng2 =%20.15f  lat2 =%20.15f\n",
          lng2[j], lat2[j]);
      } else if (abs(lat) != 90) {
        if (dlng > tol) {
          printf("        %3s: lng1 =%20.15f  lat1 =%20.15f\n",
            pcode, lng1[j], lat1);
          printf("                x =%20.15f     y =%20.15f\n",
            x[j], y[j]);
          printf("             lng2 =%20.15f  lat2 =%20.15f\n",
            lng2[j], lat2[j]);
        }
d282 1
a282 2
    }
  }
d284 2
a285 2
  printf("             Maximum residual (sky): lng%10.3E   lat%10.3E\n",
    dlngmx, dlatmx);
d288 33
a320 31
  /* Test closure at a point close to the reference point. */
  r = 1.0;
  theta = -180.0;

  drmax = 0.0;

  for (j = 1; j <= 12; j++) {
    x1[0] = r*cosd(theta);
    y1[0] = r*sind(theta);

    if ((status = prj->prjx2s(prj, 1, 1, 1, 1, x1, y1, lng1, &lat1, stat2))) {
      printf("   %3s(X2S):   x1 =%20.15f    y1 =%20.15f  ERROR%3d\n",
        pcode, x1[0], y1[0], status);

    } else if ((status = prj->prjs2x(prj, 1, 1, 1, 1, lng1, &lat1, x2, y2,
                                     stat1))) {
      printf("   %3s(S2X):   x1 =%20.15f    y1 =%20.15f\n",
        pcode, x1[0], y1[0]);
      printf("              lng =%20.15f   lat =%20.15f  ERROR%3d\n",
        lng1[0], lat1, status);

    } else {
      dr = sqrt((x2[0]-x1[0])*(x2[0]-x1[0]) + (y2[0]-y1[0])*(y2[0]-y1[0]));
      if (dr > drmax) drmax = dr;
      if (dr > tol) {
        printf("        %3s:   x1 =%20.15f    y1 =%20.15f\n",
          pcode, x1[0], y1[0]);
        printf("              lng =%20.15f   lat =%20.15f\n",
          lng1[0], lat1);
        printf("               x2 =%20.15f    y2 =%20.15f\n",
          x2[0], y2[0]);
a321 1
    }
d323 3
a325 3
    r /= 10.0;
    theta += 15.0;
  }
d327 1
a327 1
  printf("             Maximum residual (ref):  dR%10.3E\n", drmax);
d329 1
a329 1
  prjini(prj);
d331 1
a331 1
  return;
@


4.2
log
@WCSLIB 4.2: identify the name of the program in the output.
@
text
@d2 30
a31 29
*
*   WCSLIB 4.2 - an implementation of the FITS WCS convention.
*   Copyright (C) 1995-2005, Mark Calabretta
*
*   WCSLIB is free software; you can redistribute it and/or modify it under
*   the terms of the GNU General Public License as published by the Free
*   Software Foundation; either version 2 of the License, or (at your option)
*   any later version.
*
*   WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY
*   WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
*   FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
*   details.
*
*   You should have received a copy of the GNU General Public License along
*   with WCSLIB; if not, write to the Free Software Foundation, Inc.,
*   59 Temple Place, Suite 330, Boston, MA  02111-1307, USA
*
*   Correspondence concerning WCSLIB may be directed to:
*      Internet email: mcalabre@@atnf.csiro.au
*      Postal address: Dr. Mark Calabretta
*                      Australia Telescope National Facility, CSIRO
*                      PO Box 76
*                      Epping NSW 1710
*                      AUSTRALIA
*
*   Author: Mark Calabretta, Australia Telescope National Facility
*   http://www.atnf.csiro.au/~mcalabre/index.html
*   $Id: tprj1.c,v 4.1 2005/08/22 07:44:13 cal103 Exp cal103 $
a54 7
   /* Uncomment the following two lines to raise SIGFPE on floating point
    * exceptions for the Sun FORTRAN compiler.  This signal can be caught
    * within 'dbx' by issuing the command "catch FPE".
    */
/* #include <floatingpoint.h> */
/* ieee_handler("set", "common", SIGFPE_ABORT); */

d298 2
a299 1
      if (status = prj->prjx2s(prj, 1, 1, 1, 1, x1, y1, lng1, &lat1, stat2)) {
d303 2
a304 2
      } else if (status = prj->prjs2x(prj, 1, 1, 1, 1, lng1, &lat1, x2, y2,
                                      stat1)) {
@


4.2.1.1
log
@WCSLIB 4.2 development branch.
@
text
@d3 1
a3 1
*   WCSLIB 4.3 - an implementation of the FITS WCS convention.
d30 1
a30 1
*   $Id: tprj1.c,v 4.2 2005/09/22 02:15:15 cal103 Exp cal103 $
@


4.2.1.2
log
@Removed comment re catching floating point exceptions in SunOS.
@
text
@d30 1
a30 1
*   $Id: tprj1.c,v 4.2.1.1 2005/12/05 01:39:15 cal103 Exp cal103 $
d53 7
@


4.2.1.3
log
@Parenthesised assignments used as truth values.
@
text
@d4 1
a4 1
*   Copyright (C) 1995-2007, Mark Calabretta
d30 1
a30 1
*   $Id: tprj1.c,v 4.2.1.2 2005/12/16 03:48:31 cal103 Exp cal103 $
d297 1
a297 2
      if ((status = prj->prjx2s(prj, 1, 1, 1, 1, x1, y1, lng1, &lat1,
                                stat2))) {
d301 2
a302 2
      } else if ((status = prj->prjs2x(prj, 1, 1, 1, 1, lng1, &lat1, x2, y2,
                                       stat1))) {
@


4.2.1.4
log
@Switched to LGPL 3.0.
@
text
@d2 29
a30 30

    WCSLIB 4.3 - an implementation of the FITS WCS standard.
    Copyright (C) 1995-2007, Mark Calabretta

    This file is part of WCSLIB.

    WCSLIB is free software: you can redistribute it and/or modify it under
    the terms of the GNU Lesser General Public License as published by the
    Free Software Foundation, either version 3 of the License, or (at your
    option) any later version.

    WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY
    WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
    FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for
    more details.

    You should have received a copy of the GNU Lesser General Public License
    along with WCSLIB.  If not, see <http://www.gnu.org/licenses/>.

    Correspondence concerning WCSLIB may be directed to:
       Internet email: mcalabre@@atnf.csiro.au
       Postal address: Dr. Mark Calabretta
                       Australia Telescope National Facility, CSIRO
                       PO Box 76
                       Epping NSW 1710
                       AUSTRALIA

    Author: Mark Calabretta, Australia Telescope National Facility
    http://www.atnf.csiro.au/~mcalabre/index.html
    $Id: tprj1.c,v 4.2.1.3 2007/06/29 06:41:51 cal103 Exp cal103 $
@


4.1
log
@WCSLIB 4.1: trivial changes.
@
text
@d3 1
a3 1
*   WCSLIB 4.1 - an implementation of the FITS WCS convention.
d30 1
a30 1
*   $Id: tprj1.c,v 4.0 2005/02/04 06:31:54 cal103 Exp cal103 $
d62 3
a64 2
   printf("\nTesting closure of WCSLIB spherical projection routines\n");
   printf("-------------------------------------------------------\n");
@


4.0
log
@WCSLIB 4.0: changed from LGPL to GPL; test closure for the new HPX projection.
@
text
@d3 1
a3 1
*   WCSLIB 4.0 - an implementation of the FITS WCS convention.
d30 1
a30 1
*   $Id: tprj1.c,v 3.6 2004/08/25 05:35:49 cal103 Exp cal103 $
d50 1
a50 1
   register int j;
d67 2
a68 2
   for (j = 1; j <= 4 ; j++) {
      printf("   %d: %s.\n", j, prj_errmsg[j]);
d184 1
a184 1
   /* HPX: quadrilateralized spherical cube. */
d243 1
a243 1
         printf("   %3s(S2X): %s\n", pcode, prj_errmsg[1]);
d248 1
a248 1
         printf("   %3s(X2S): %s\n", pcode, prj_errmsg[1]);
@


3.6
log
@WCSLIB 3.6: "error status/code/number" is now referred to consistently as the
"status return value"; in error messages, print "ERROR" (in uppercase) -
POSIX standard; removed support for K&R C.
@
text
@d3 2
a4 2
*   WCSLIB 3.6 - an implementation of the FITS WCS convention.
*   Copyright (C) 1995-2004, Mark Calabretta
d6 9
a14 9
*   This program is free software; you can redistribute it and/or modify it
*   under the terms of the GNU General Public License as published by the
*   Free Software Foundation; either version 2 of the License, or (at your
*   option) any later version.
*
*   This program is distributed in the hope that it will be useful, but
*   WITHOUT ANY WARRANTY; without even the implied warranty of
*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
*   General Public License for more details.
d17 2
a18 2
*   with this library; if not, write to the Free Software Foundation, Inc.,
*   675 Mass Ave, Cambridge, MA 02139, USA.
d30 1
a30 1
*   $Id: tprj1.c,v 3.5 2004/06/28 01:05:32 mcalabre Exp mcalabre $
d183 5
@


3.5
log
@WCSLIB 3.5
@
text
@d3 1
a3 1
*   WCSLIB 3.5 - an implementation of the FITS WCS convention.
d30 1
a30 1
*   $Id: tprj1.c,v 3.4 2004/02/11 00:23:05 mcalabre Exp mcalabre $
a44 5
#ifndef __STDC__
#ifndef const
#define const
#endif
#endif
a45 1

d65 2
a66 2
   /* List error messages. */
   printf("\nList of prj error codes:\n");
d253 1
a253 1
            printf("                x =%20.15f     y =%20.15f  error%3d\n",
d299 1
a299 1
         printf("   %3s(X2S):   x1 =%20.15f    y1 =%20.15f  error%3d\n",
d306 1
a306 1
         printf("              lng =%20.15f   lat =%20.15f  error%3d\n",
@


3.4
log
@WCSLIB 3.4
@
text
@d3 1
a3 1
*   WCSLIB 3.4 - an implementation of the FITS WCS convention.
d28 3
a34 1
*   $Id: tprj1.c,v 3.3 2003/10/21 08:10:05 mcalabre Exp mcalabre $
@


3.3
log
@WCSLIB 3.3
@
text
@d3 2
a4 2
*   WCSLIB 3.3 - an implementation of the FITS WCS convention.
*   Copyright (C) 1995-2003, Mark Calabretta
d32 1
a32 1
*   $Id: tprj1.c,v 3.2 2003/09/09 04:40:16 mcalabre Exp mcalabre $
@


3.2
log
@WCSLIB 3.2: rationalized function return codes and messages.
@
text
@d3 1
a3 1
*   WCSLIB 3.2 - an implementation of the FITS WCS convention.
d32 1
a32 1
*   $Id: tprj1.c,v 3.1 2003/04/28 04:27:07 mcalabre Exp mcalabre $
d134 1
a134 1
   /* CAR: Cartesian. */
@


3.1
log
@WCSLIB 3.1
@
text
@d3 1
a3 1
*   WCSLIB 3.1 - an implementation of the FITS WCS convention.
d32 1
a32 1
*   $Id: tprj1.c,v 3.0 2003/04/01 04:16:39 mcalabre Exp mcalabre $
d70 3
a72 3
   printf("\nList of prjset error codes:\n");
   for (j = 1; j <= 1 ; j++) {
      printf("   %d: %s.\n", j, prjset_errmsg[j]);
a74 10
   printf("\nList of prjx2s error codes:\n");
   for (j = 1; j <= 2 ; j++) {
      printf("   %d: %s.\n", j, prjx2s_errmsg[j]);
   }

   printf("\nList of prjs2x error codes:\n");
   for (j = 1; j <= 2 ; j++) {
      printf("   %d: %s.\n", j, prjs2x_errmsg[j]);
   }

d242 1
a242 1
         printf("   %3s(S2X): %s\n", pcode, prjs2x_errmsg[1]);
d247 1
a247 1
         printf("   %3s(X2S): %s\n", pcode, prjx2s_errmsg[1]);
@


3.0
log
@WCSLIB 3.0 (renamed from tproj1.c).
@
text
@d3 1
a3 1
*   WCSLIB 3.0 - an implementation of the FITS WCS convention.
d32 1
a32 1
*   $Id: tproj1.c,v 2.12 2001/11/15 02:57:09 mcalabre Exp $
@


2.13
log
@Updated date in copyright notice.
@
text
@d3 2
a4 2
*   WCSLIB - an implementation of the FITS WCS proposal.
*   Copyright (C) 1995-2002, Mark Calabretta
d22 4
a25 4
*      Postal address: Dr. Mark Calabretta,
*                      Australia Telescope National Facility,
*                      P.O. Box 76,
*                      Epping, NSW, 2121,
d30 1
a30 1
*   tproj1 tests forward and reverse spherical projections for closure.
d32 1
a32 1
*   $Id: tproj1.c,v 2.12 2001/11/15 02:57:09 mcalabre Exp mcalabre $
d38 1
a38 2
#include "wcstrig.h"
#include "proj.h"
d40 3
d71 3
a73 1
   printf("   %d: %s.\n", 1, prjset_errmsg[1]);
d75 3
a77 3
   printf("\nList of prjfwd error codes:\n");
   for (j = 1; j <=2 ; j++) {
      printf("   %d: %s.\n", j, prjfwd_errmsg[j]);
d80 3
a82 3
   printf("\nList of prjrev error codes:\n");
   for (j = 1; j <=2 ; j++) {
      printf("   %d: %s.\n", j, prjrev_errmsg[j]);
d85 1
a85 1
   printf("\n\n");
d88 1
a88 1
   for (j = 0; j < 10; prj.p[j++] = 0.0);
d91 2
a92 2
   prj.p[1] =   0.5;
   prj.p[2] =  30.0;
d96 3
a98 3
   prj.p[1] =   0.5;
   prj.p[2] = 210.0;
   prj.p[3] =  60.0;
d108 2
a109 2
   prj.p[1] = -0.3;
   prj.p[2] =  0.5;
d116 10
a125 10
   prj.p[0] =  0.00000;
   prj.p[1] =  0.95000;
   prj.p[2] = -0.02500;
   prj.p[3] = -0.15833;
   prj.p[4] =  0.00208;
   prj.p[5] =  0.00792;
   prj.p[6] = -0.00007;
   prj.p[7] = -0.00019;
   prj.p[8] =  0.00000;
   prj.p[9] =  0.00000;
d132 1
a132 1
   prj.p[1] = 45.0;
d136 2
a137 2
   prj.p[1] = 3.0;
   prj.p[2] = 0.8;
d141 1
a141 1
   prj.p[1] = 0.75;
d163 2
a164 2
   prj.p[1] =  60.0;
   prj.p[2] =  15.0;
d168 2
a169 2
   prj.p[1] =  60.0;
   prj.p[2] = -15.0;
d173 2
a174 2
   prj.p[1] = -60.0;
   prj.p[2] =  15.0;
d178 2
a179 2
   prj.p[1] = -60.0;
   prj.p[2] = -15.0;
d183 1
a183 1
   prj.p[1] = 30.0;
d223 1
a223 1
   int    err, lat, lng;
d225 5
a229 2
   double dlat, dlatmx, dlng, dlngmx, dr, drmax, lat1, lat2, lng1, lng2;
   double r, theta, x, x1, x2, y, y1, y2;
d231 1
a231 2
   prj->flag = 0;
   prj->r0 = 0.0;
d233 3
a235 1
   prjset(pcode, prj);
d237 1
a237 1
   printf("Testing %s; latitudes %3d to %4d, reporting tolerance %5.1g deg.\n",
d243 1
a243 4
   /* Uncomment the next line to test alternative initializations of */
   /* projection parameters.                                         */
   /* prj->r0 = R2D; */

d247 13
a259 2
      for (lng = -180; lng <= 180; lng++) {
         lng1 = (double)lng;
d261 2
a262 7
         if (err = prj->prjfwd(lng1, lat1, prj, &x, &y)) {
            if (err != 2) {
               printf("        %3s: lng1 =%20.15f  lat1 =%20.15f  error %3d\n",
                  pcode, lng1, lat1, err);
            }
            continue;
         }
d264 3
a266 3
         if (err = prj->prjrev(x, y, prj, &lng2, &lat2)) {
            printf("        %3s: lng1 =%20.15f  lat1 =%20.15f\n",
               pcode, lng1, lat1);
d268 1
a268 1
               x, y, err);
d272 1
a272 1
         dlng = fabs(lng2-lng1);
d275 1
a275 1
         dlat = fabs(lat2-lat1);
d280 3
a282 2
               pcode, lng1, lat1);
            printf("                x =%20.15f     y =%20.15f\n", x, y);
d284 1
a284 1
               lng2, lat2);
d288 3
a290 2
                  pcode, lng1, lat1);
               printf("                x =%20.15f     y =%20.15f\n", x, y);
d292 1
a292 1
                  lng2, lat2);
d298 1
a298 1
   printf("             Maximum residual (sky): lng%10.3e   lat%10.3e\n",
d309 2
a310 2
      x1 = r*cosd(theta);
      y1 = r*sind(theta);
d312 8
a319 7
      if (err = prj->prjrev(x1, y1, prj, &lng1, &lat1)) {
         printf("        %3s:   x1 =%20.15f    y1 =%20.15f  error%3d\n",
            pcode, x1, y1, err);

      } else if (err = prj->prjfwd(lng1, lat1, prj, &x2, &y2)) {
         printf("        %3s:   x1 =%20.15f    y1 =%20.15f\n",
            pcode, x1, y1);
d321 1
a321 1
            lng1, lat1, err);
d324 1
a324 1
         dr = sqrt((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1));
d328 1
a328 1
               pcode, x1, y1);
d330 1
a330 1
               lng1, lat1);
d332 1
a332 1
               x2, y2);
d340 1
a340 1
   printf("             Maximum residual (ref):  dR%10.3e\n", drmax);
d342 1
a342 1
   for (j = 0; j < 10; prj->p[j++] = 0.0);
@


2.12
log
@Test AZP with gamma = 30; added new test for SZP; revised parameters for the
SIN projection; removed the pointers to the forward and reverse projection
routines from the argument list to projex(); ignore error 2 returned from
prjfwd().
@
text
@d4 1
a4 1
*   Copyright (C) 1995-2001, Mark Calabretta
d32 1
a32 1
*   $Id: tproj1.c,v 2.11 2000/12/04 06:45:52 mcalabre Exp mcalabre $
@


2.11
log
@Eliminated GNU compiler warnings; reordered projections to match paper.
@
text
@d4 1
a4 1
*   Copyright (C) 1995-2000, Mark Calabretta
d32 1
a32 1
*   $Id: tproj1.c,v 2.10 2000/05/10 04:44:05 mcalabre Exp mcalabre $
d87 9
a95 2
   prj.p[1] = 2.0;
   projex("AZP", azpfwd, azprev, &prj, 90, -30, tol);
d98 1
a98 1
   projex("TAN", tanfwd, tanrev, &prj, 90, 5, tol);
d101 1
a101 1
   projex("STG", stgfwd, stgrev, &prj, 90, -85, tol);
d104 3
a106 3
   prj.p[1] = 0.3;
   prj.p[2] = 1.5;
   projex("SIN", sinfwd, sinrev, &prj, 90, 60, tol);
d109 1
a109 1
   projex("ARC", arcfwd, arcrev, &prj, 90, -90, tol);
d122 1
a122 1
   projex("ZPN", zpnfwd, zpnrev, &prj, 90, 10, tol);
d125 1
a125 1
   projex("ZEA", zeafwd, zearev, &prj, 90, -90, tol);
d129 1
a129 1
   projex("AIR", airfwd, airrev, &prj, 90, -85, tol);
d134 1
a134 1
   projex("CYP", cypfwd, cyprev, &prj, 90, -90, tol);
d138 1
a138 1
   projex("CEA", ceafwd, cearev, &prj, 90, -90, tol);
d141 1
a141 1
   projex("CAR", carfwd, carrev, &prj, 90, -90, tol);
d144 1
a144 1
   projex("MER", merfwd, merrev, &prj, 85, -85, tol);
d147 1
a147 1
   projex("SFL", sflfwd, sflrev, &prj, 90, -90, tol);
d150 1
a150 1
   projex("PAR", parfwd, parrev, &prj, 90, -90, tol);
d153 1
a153 1
   projex("MOL", molfwd, molrev, &prj, 90, -90, tol);
d156 1
a156 1
   projex("AIT", aitfwd, aitrev, &prj, 90, -90, tol);
d161 1
a161 1
   projex("COP", copfwd, coprev, &prj, 90, -25, tol);
d166 1
a166 1
   projex("COE", coefwd, coerev, &prj, 90, -90, tol);
d171 1
a171 1
   projex("COD", codfwd, codrev, &prj, 90, -90, tol);
d176 1
a176 1
   projex("COO", coofwd, coorev, &prj, 85, -90, tol);
d180 1
a180 1
   projex("BON", bonfwd, bonrev, &prj, 90, -90, tol);
d183 1
a183 1
   projex("PCO", pcofwd, pcorev, &prj, 90, -90, tol);
d186 1
a186 1
   projex("TSC", tscfwd, tscrev, &prj, 90, -90, tol);
d189 1
a189 1
   projex("CSC", cscfwd, cscrev, &prj, 90, -90, 4.0e-2);
d192 1
a192 1
   projex("QSC", qscfwd, qscrev, &prj, 90, -90, tol);
a202 2
*      *prjfwd() int      Forward projection routine.
*      *prjrev() int      Reverse projection routine.
d211 1
a211 1
void projex(pcode, prjfwd, prjrev, prj, north, south, tol)
d214 1
a214 1
int    (*prjfwd)(), (*prjrev)(), north, south;
a223 3
   printf("Testing %s; latitudes %3d to %4d, reporting tolerance %5.1g deg.\n",
      pcode, north, south, tol);

d227 5
d245 5
a249 3
         if (err = prjfwd(lng1, lat1, prj, &x, &y)) {
            printf("        %3s: lng1 =%20.15f  lat1 =%20.15f  error %3d\n",
               pcode, lng1, lat1, err);
d253 1
a253 1
         if (err = prjrev(x, y, prj, &lng2, &lat2)) {
d299 1
a299 1
      if (err = prjrev(x1, y1, prj, &lng1, &lat1)) {
d303 1
a303 1
      } else if (err = prjfwd(lng1, lat1, prj, &x2, &y2)) {
@


2.10
log
@Updated date in copyright notice.
@
text
@d32 1
a32 1
*   $Id: tproj1.c,v 2.9 2000/01/31 07:02:47 mcalabre Exp mcalabre $
d48 1
a48 1
main()
d93 3
a100 3
   /* STG: stereographic. */
   projex("STG", stgfwd, stgrev, &prj, 90, -85, tol);

d129 4
d139 11
a149 3
   /* CEA: cylindrical equal area. */
   prj.p[1] = 0.75;
   projex("CEA", ceafwd, cearev, &prj, 90, -90, tol);
d156 5
a165 5
   /* COE: conic equal area. */
   prj.p[1] =  60.0;
   prj.p[2] = -15.0;
   projex("COE", coefwd, coerev, &prj, 90, -90, tol);

d178 2
a179 11
   /* GLS: Sanson-Flamsteed (global sinusoid). */
   projex("GLS", glsfwd, glsrev, &prj, 90, -90, tol);

   /* PAR: parabolic. */
   projex("PAR", parfwd, parrev, &prj, 90, -90, tol);

   /* AIT: Hammer-Aitoff. */
   projex("AIT", aitfwd, aitrev, &prj, 90, -90, tol);

   /* MOL: Mollweide's projection. */
   projex("MOL", molfwd, molrev, &prj, 90, -90, tol);
a186 3
   /* TSC: tangential spherical cube. */
   projex("TSC", tscfwd, tscrev, &prj, 90, -90, tol);

d239 1
a239 1
            printf("        %3s: lng1 =%20.15lf  lat1 =%20.15lf  error %3d\n",
d245 1
a245 1
            printf("        %3s: lng1 =%20.15lf  lat1 =%20.15lf\n",
d247 1
a247 1
            printf("                x =%20.15lf     y =%20.15lf  error%3d\n",
d259 1
a259 1
            printf("        %3s: lng1 =%20.15lf  lat1 =%20.15lf\n",
d261 2
a262 2
            printf("                x =%20.15lf     y =%20.15lf\n", x, y);
            printf("             lng2 =%20.15lf  lat2 =%20.15lf\n",
d266 1
a266 1
               printf("        %3s: lng1 =%20.15lf  lat1 =%20.15lf\n",
d268 2
a269 2
               printf("                x =%20.15lf     y =%20.15lf\n", x, y);
               printf("             lng2 =%20.15lf  lat2 =%20.15lf\n",
d276 1
a276 1
   printf("             Maximum residual (sky): lng%10.3le   lat%10.3le\n",
d291 1
a291 1
         printf("        %3s:   x1 =%20.15lf    y1 =%20.15lf  error%3d\n",
d295 1
a295 1
         printf("        %3s:   x1 =%20.15lf    y1 =%20.15lf\n",
d297 1
a297 1
         printf("              lng =%20.15lf   lat =%20.15lf  error%3d\n",
d304 1
a304 1
            printf("        %3s:   x1 =%20.15lf    y1 =%20.15lf\n",
d306 1
a306 1
            printf("              lng =%20.15lf   lat =%20.15lf\n",
d308 1
a308 1
            printf("               x2 =%20.15lf    y2 =%20.15lf\n",
d317 1
a317 1
   printf("             Maximum residual (ref):  dR%10.3le\n", drmax);
@


2.9
log
@Fixed comment concerning use of ieee_handler().
@
text
@d4 1
a4 1
*   Copyright (C) 1995-1999, Mark Calabretta
d32 1
a32 1
*   $Id: tproj1.c,v 2.8 1999/12/13 07:33:01 mcalabre Exp mcalabre $
@


2.8
log
@Revised include file handling; added return statement.
@
text
@d32 1
a32 1
*   $Id: tproj1.c,v 2.7 1999/12/13 03:41:27 mcalabre Exp mcalabre $
d61 1
a61 1
/* call ieee_handler ("set", "common", SIGFPE_ABORT); */
@


2.7
log
@Lowered reporting tolerance to 1e-9 (was 1e-10).
@
text
@d32 1
a32 1
*   $Id: tproj1.c,v 2.6 1999/11/19 00:29:42 mcalabre Exp mcalabre $
d35 1
d38 1
d187 1
a187 1
   exit(0);
@


2.6
log
@Removed test for the DSS projection.
@
text
@d32 1
a32 1
*   $Id: tproj1.c,v 2.5 1999/11/19 00:28:15 mcalabre Exp mcalabre $
d51 1
a51 1
   const double tol = 1.0e-10;
@


2.5
log
@"Closure tolerance" becomes "Reporting tolerance".
@
text
@d32 1
a32 1
*   $Id: tproj1.c,v 2.4 1998/02/25 07:05:50 mcalabre Exp mcalabre $
a183 30

   /* DSS: Digitized Sky Survey plate solution. */
   for (j = 0; j < 41; prj.p[j++] = 0.0);
   prj.p[1]  =  6.7234393905749e+1;
   prj.p[2]  = -6.1206212502750e-2;
   prj.p[3]  =  1.5759396719012e+0;
   prj.p[4]  =  6.1080557365045e-6;
   prj.p[5]  = -2.6552938895374e-6;
   prj.p[6]  =  4.4723731979254e-6;
   prj.p[7]  =  0.0;
   prj.p[8]  =  2.2738613554068e-6;
   prj.p[9]  =  1.1780229217156e-7;
   prj.p[10] =  2.3127913803362e-6;
   prj.p[11] =  2.6947954285615e-7;
   prj.p[12] =  0.0;
   prj.p[13] =  0.0;
   prj.p[21] =  6.7235533666628e+1;
   prj.p[22] =  4.7635767340281e-2;
   prj.p[23] = -7.8406019970120e-1;
   prj.p[24] =  1.5939998327381e-6;
   prj.p[25] =  1.8975126432299e-6;
   prj.p[26] = -8.5014528625798e-6;
   prj.p[27] =  0.0;
   prj.p[28] =  2.3477758536500e-6;
   prj.p[29] = -3.4484897053509e-8;
   prj.p[30] =  2.4396799598502e-6;
   prj.p[31] =  1.7572855739632e-8;
   prj.p[32] =  0.0;
   prj.p[33] =  0.0;
   projex("DSS", dssfwd, dssrev, &prj, 90, 5, tol);
@


2.4
log
@Updated date in copyright notice.
@
text
@d4 1
a4 1
*   Copyright (C) 1995-1998, Mark Calabretta
d32 1
a32 1
*   $Id: tproj1.c,v 2.3 1998/01/30 00:19:21 mcalabre Exp mcalabre $
d228 1
a231 1
*      tol       double   Closure tolerance, degrees.
d247 1
a247 1
   printf("Testing %s; latitudes %3d to %4d, reporting tolerance %8.1g deg.\n",
d345 1
a345 1
   printf("             Maximum residual (map):  dR%10.3le\n", drmax);
@


2.3
log
@Added test for the DSS projection.  Also, include <stdlib.h>, and replace
return from main with exit.
@
text
@d4 1
a4 1
*   Copyright (C) 1995-1997 Mark Calabretta
d32 1
a32 1
*   $Id: tproj1.c,v 2.2 1996/05/07 20:29:35 mcalabre Exp mcalabre $
@


2.2
log
@Print predefined error messages.
@
text
@d4 1
a4 1
*   Copyright (C) 1995,1996 Mark Calabretta
d32 1
a32 1
*   $Id: tproj1.c,v 2.1 1995/12/22 02:43:29 mcalabre Exp mcalabre $
d35 1
d185 31
a215 1
   return 0;
d247 1
a247 1
   printf("Testing %s; latitudes %3d to %4d, closure tolerance %8.1g deg.\n",
@


2.1
log
@Test prj->p[1] < 0 and/or prj->p[2] < 0 for the conics.
@
text
@d4 1
a4 1
*   Copyright (C) 1995, Mark Calabretta
d32 1
a32 1
*   $Id: tproj1.c,v 2.0 1995/09/12 06:33:39 mcalabre Exp mcalabre $
d59 21
@


2.0
log
@WCSLIB 2.0
@
text
@d32 1
a32 1
*   $Id: tproj1.c,v 1.2 1995/09/12 06:31:36 mcalabre Exp mcalabre $
d116 2
a117 2
   prj.p[1] = 60.0;
   prj.p[2] = 15.0;
d121 2
a122 2
   prj.p[1] = 60.0;
   prj.p[2] = 15.0;
d126 2
a127 2
   prj.p[1] = 60.0;
   prj.p[2] = 15.0;
d131 3
a133 3
   prj.p[1] = 60.0;
   prj.p[2] = 15.0;
   projex("COO", coofwd, coorev, &prj, 90, -85, tol);
@


1.2
log
@1) Reference latitude for conics now at the midpoint of the standard
   parallels.
2) Test closure at points close to the reference point.
3) Report maximum closure residuals.
@
text
@d32 1
a32 1
*   $Id: tproj1.c,v 1.1 1995/01/31 03:13:15 mcalabre Exp mcalabre $
@


1.1
log
@Initial revision
@
text
@d32 1
a32 1
*   $Id$
d35 1
d81 1
a81 1
   prj.p[0] =  0.05000;
d116 2
a117 2
   prj.p[1] = 45.0;
   prj.p[2] = 75.0;
d121 2
a122 2
   prj.p[1] = 45.0;
   prj.p[2] = 75.0;
d126 2
a127 2
   prj.p[1] = 45.0;
   prj.p[2] = 75.0;
d131 2
a132 2
   prj.p[1] = 45.0;
   prj.p[2] = 75.0;
d192 2
a193 1
   double lng1, lng2, lat1, lat2, x, y;
d201 3
d215 1
a215 1
            printf("%3s: lng1 =%20.15lf  lat1 =%20.15lf  error %3d\n",
d220 2
a221 2
         if (err = prjrev (x, y, prj, &lng2, &lat2)) {
            printf("%3s: lng1 =%20.15lf  lat1 =%20.15lf\n",
d223 1
a223 1
            printf("        x =%20.15lf     y =%20.15lf  error%3d\n",
d228 8
a235 2
         if (fabs(lat2-lat1) > tol) {
            printf("%3s: lng1 =%20.15lf  lat1 =%20.15lf\n",
d237 3
a239 2
            printf("        x =%20.15lf     y =%20.15lf\n", x, y);
            printf("     lng2 =%20.15lf  lat2 =%20.15lf\n", lng2, lat2);
d241 6
a246 7
            if (fabs(lng2-lng1) > tol) {
               if (fabs(fabs(lng2-lng1)-360.0) > tol) {
                  printf("%3s: lng1 =%20.15lf  lat1 =%20.15lf\n",
                     pcode, lng1, lat1);
                  printf("        x =%20.15lf     y =%20.15lf\n", x, y);
                  printf("     lng2 =%20.15lf  lat2 =%20.15lf\n", lng2, lat2);
               }
d251 43
@
