Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[ISSUE #17] Corrected the angle functions to fix the incorrected results strans function according to the documentation.#32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
vitcpp merged 2 commits intopostgrespro:masterfromdura0ok:17_fix_theta_function
Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletionsMakefile
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
PGSPHERE_VERSION = 1.2.2
PGSPHERE_VERSION = 1.2.3
EXTENSION = pg_sphere
RELEASE_SQL = $(EXTENSION)--$(PGSPHERE_VERSION).sql
USE_PGXS = 1
Expand DownExpand Up@@ -26,7 +26,8 @@ DATA_built = $(RELEASE_SQL) \
pg_sphere--1.1.5beta2gavo--1.1.5beta4gavo.sql \
pg_sphere--1.1.5beta4gavo--1.2.0.sql \
pg_sphere--1.2.0--1.2.1.sql \
pg_sphere--1.2.1--1.2.2.sql
pg_sphere--1.2.1--1.2.2.sql \
pg_sphere--1.2.2--1.2.3.sql

DOCS = README.pg_sphere COPYRIGHT.pg_sphere
REGRESS = init tables points euler circle line ellipse poly path box index \
Expand DownExpand Up@@ -256,6 +257,9 @@ pg_sphere--1.2.1--1.2.2.sql:
cat upgrade_scripts/$@.in > $@
endif

pg_sphere--1.2.2--1.2.3.sql:
cat upgrade_scripts/$@.in > $@

# end of local stuff

src/sscan.o : src/sparse.c
Expand Down
138 changes: 138 additions & 0 deletionsexpected/euler.out
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -17,3 +17,141 @@ SELECT strans '-40d,0d,40d,ZZZ' <> '-40d,0d,40d,XXX' ;
f
(1 row)

SELECT strans ( 20.0*pi()/180.0, -270.0*pi()/180.0, 70.5*pi()/180.0, 'XZY' );
strans
---------------------------------------
0.34906585, 1.5707963, 1.2304571, XZY
(1 row)

SELECT theta( strans ( 20.0*pi()/180.0, -270.0*pi()/180.0, 70.5*pi()/180.0, 'XZY' ) );
theta
---------------
1.57079632679
(1 row)

SELECT psi( strans ( 20.0*pi()/180.0, -270.0*pi()/180.0, 70.5*pi()/180.0, 'XZY' ) );
psi
---------------
1.23045712266
(1 row)

SELECT phi( strans ( 20.0*pi()/180.0, -270.0*pi()/180.0, 70.5*pi()/180.0, 'XZY' ) );
phi
----------------
0.349065850399
(1 row)

SELECT theta( strans( '20d, 30d, 40d, XZY' ) );
theta
----------------
0.523598775598
(1 row)

SELECT psi( strans( '20d, 30d, 40d, XZY' ) );
psi
----------------
0.698131700798
(1 row)

SELECT phi( strans( '20d, 30d, 40d, XZY' ) );
phi
----------------
0.349065850399
(1 row)

SELECT strans( '2d 20m, 10d, 0' );
strans
---------------------------------
0.040724349, 0.17453293, 0, ZXZ
(1 row)

SELECT theta( strans( '2d 20m, 10d, 0' ) );
theta
----------------
0.174532925199
(1 row)

SELECT psi( strans( '2d 20m, 10d, 0' ) );
psi
-----
0
(1 row)

SELECT phi( strans( '2d 20m, 10d, 0' ) );
phi
-----------------
0.0407243492132
(1 row)

SELECT strans ( '10d, 90d, 270d, ZXZ' );
strans
--------------------------------------
0.17453293, 1.5707963, 4.712389, ZXZ
(1 row)

SELECT theta( strans ( '10d, 90d, 270d, ZXZ' ) );
theta
---------------
1.57079632679
(1 row)

SELECT psi( strans ( '10d, 90d, 270d, ZXZ' ) );
psi
---------------
4.71238898038
(1 row)

SELECT phi( strans ( '10d, 90d, 270d, ZXZ' ) );
phi
----------------
0.174532925199
(1 row)

SELECT - strans ( '20d, 50d, 80d, XYZ' );
?column?
--------------------------------------
4.8869219, 5.4105207, 5.9341195, ZYX
(1 row)

SELECT theta( - strans ( '20d, 50d, 80d, XYZ' ) );
theta
-----------------
-0.872664625997
(1 row)

SELECT psi( - strans ( '20d, 50d, 80d, XYZ' ) );
psi
-----------------
-0.349065850399
(1 row)

SELECT phi( - strans ( '20d, 50d, 80d, XYZ' ) );
phi
---------------
-1.3962634016
(1 row)

SELECT strans( '90d, 60d, 30d' );
strans
---------------------------------------
1.5707963, 1.0471976, 0.52359878, ZXZ
(1 row)

SELECT theta( strans( '90d, 60d, 30d' ) );
theta
--------------
1.0471975512
(1 row)

SELECT psi( strans( '90d, 60d, 30d' ) );
psi
----------------
0.523598775598
(1 row)

SELECT phi( strans( '90d, 60d, 30d' ) );
phi
---------------
1.57079632679
(1 row)

2 changes: 1 addition & 1 deletionexpected/init.out
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,6 +6,6 @@ CREATE EXTENSION pg_sphere;
select pg_sphere_version();
pg_sphere_version
-------------------
1.2.2
1.2.3
(1 row)

2 changes: 0 additions & 2 deletionspg_sphere--1.2.2.sql.in
View file
Open in desktop

This file was deleted.

File renamed without changes.
2 changes: 1 addition & 1 deletionpg_sphere.control
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
# pg_sphere extension
comment = 'spherical objects with useful functions, operators and index support'
default_version = '1.2.2'
default_version = '1.2.3'
module_pathname = '$libdir/pg_sphere'
relocatable = true
46 changes: 46 additions & 0 deletionssql/euler.sql
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,55 @@
\set ECHO none
SELECT set_sphere_output_precision(8);
SET extra_float_digits TO -3;
\set ECHO all

-- checking Euler transformation operators

SELECT strans '-10d,0d,10d,ZZZ' = '-10d,0d,10d,XXX' ;
SELECT strans '-40d,0d,40d,ZZZ' <> '-40d,0d,40d,XXX' ;

SELECT strans ( 20.0*pi()/180.0, -270.0*pi()/180.0, 70.5*pi()/180.0, 'XZY' );

SELECT theta( strans ( 20.0*pi()/180.0, -270.0*pi()/180.0, 70.5*pi()/180.0, 'XZY' ) );

SELECT psi( strans ( 20.0*pi()/180.0, -270.0*pi()/180.0, 70.5*pi()/180.0, 'XZY' ) );

SELECT phi( strans ( 20.0*pi()/180.0, -270.0*pi()/180.0, 70.5*pi()/180.0, 'XZY' ) );

SELECT theta( strans( '20d, 30d, 40d, XZY' ) );

SELECT psi( strans( '20d, 30d, 40d, XZY' ) );

SELECT phi( strans( '20d, 30d, 40d, XZY' ) );

SELECT strans( '2d 20m, 10d, 0' );

SELECT theta( strans( '2d 20m, 10d, 0' ) );

SELECT psi( strans( '2d 20m, 10d, 0' ) );

SELECT phi( strans( '2d 20m, 10d, 0' ) );

SELECT strans ( '10d, 90d, 270d, ZXZ' );

SELECT theta( strans ( '10d, 90d, 270d, ZXZ' ) );

SELECT psi( strans ( '10d, 90d, 270d, ZXZ' ) );

SELECT phi( strans ( '10d, 90d, 270d, ZXZ' ) );

SELECT - strans ( '20d, 50d, 80d, XYZ' );

SELECT theta( - strans ( '20d, 50d, 80d, XYZ' ) );

SELECT psi( - strans ( '20d, 50d, 80d, XYZ' ) );

SELECT phi( - strans ( '20d, 50d, 80d, XYZ' ) );

SELECT strans( '90d, 60d, 30d' );

SELECT theta( strans( '90d, 60d, 30d' ) );

SELECT psi( strans( '90d, 60d, 30d' ) );

SELECT phi( strans( '90d, 60d, 30d' ) );
7 changes: 3 additions & 4 deletionssrc/euler.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -203,23 +203,22 @@ spheretrans_phi(PG_FUNCTION_ARGS)
{
SEuler *se = (SEuler *) PG_GETARG_POINTER(0);

PG_RETURN_POINTER(&se->phi);
PG_RETURN_FLOAT8(se->phi);
}

Datum
spheretrans_theta(PG_FUNCTION_ARGS)
{
SEuler *se = (SEuler *) PG_GETARG_POINTER(0);

PG_RETURN_POINTER(&se->theta);
PG_RETURN_FLOAT8(se->theta);
}

Datum
spheretrans_psi(PG_FUNCTION_ARGS)
{
SEuler *se = (SEuler *) PG_GETARG_POINTER(0);

PG_RETURN_POINTER(&se->psi);
PG_RETURN_FLOAT8(se->psi);
}

Datum
Expand Down
1 change: 1 addition & 0 deletionsupgrade_scripts/pg_sphere--1.2.2--1.2.3.sql.in
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
-- Nothing to upgrade in the schema

[8]ページ先頭

©2009-2025 Movatter.jp