Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Orekit
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Orekit
Orekit
Commits
4b65f655
Commit
4b65f655
authored
16 years ago
by
Luc Maisonobe
Browse files
Options
Downloads
Patches
Plain Diff
added test for SpinStabilized
parent
2c9e2f88
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/test/java/org/orekit/attitudes/SpinStabilizedTest.java
+61
-0
61 additions, 0 deletions
src/test/java/org/orekit/attitudes/SpinStabilizedTest.java
with
61 additions
and
0 deletions
src/test/java/org/orekit/attitudes/SpinStabilizedTest.java
0 → 100644
+
61
−
0
View file @
4b65f655
/* Copyright 2002-2008 CS Communication & Systèmes
* Licensed to CS Communication & Systèmes (CS) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* CS licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.orekit.attitudes
;
import
org.apache.commons.math.geometry.Vector3D
;
import
org.orekit.errors.OrekitException
;
import
org.orekit.forces.Sun
;
import
org.orekit.frames.Frame
;
import
org.orekit.time.AbsoluteDate
;
import
org.orekit.utils.PVCoordinates
;
import
junit.framework.Test
;
import
junit.framework.TestCase
;
import
junit.framework.TestSuite
;
public
class
SpinStabilizedTest
extends
TestCase
{
public
SpinStabilizedTest
(
String
name
)
{
super
(
name
);
}
public
void
testBBQMode
()
throws
OrekitException
{
Sun
sun
=
new
Sun
();
AbsoluteDate
date
=
new
AbsoluteDate
(
AbsoluteDate
.
J2000_EPOCH
,
12345.6789
);
double
rate
=
2.0
*
Math
.
PI
/
(
12
*
60
);
AttitudeLaw
bbq
=
new
SpinStabilized
(
new
CelestialBodyPointed
(
Frame
.
getJ2000
(),
sun
,
Vector3D
.
PLUS_K
,
Vector3D
.
PLUS_I
,
Vector3D
.
PLUS_K
),
date
,
Vector3D
.
PLUS_K
,
rate
);
PVCoordinates
pv
=
new
PVCoordinates
(
new
Vector3D
(
28823536.58654545
,
5893400.545304828
,
0
),
new
Vector3D
(
0
,
0
,
3680.853673522056
));
Attitude
attitude
=
bbq
.
getState
(
date
,
pv
,
Frame
.
getJ2000
());
Vector3D
xDirection
=
attitude
.
getRotation
().
applyInverseTo
(
Vector3D
.
PLUS_I
);
assertEquals
(
Math
.
atan
(
1.0
/
5000.0
),
Vector3D
.
angle
(
xDirection
,
sun
.
getPosition
(
date
,
Frame
.
getJ2000
())),
1.0
e
-
15
);
assertEquals
(
rate
,
attitude
.
getSpin
().
getNorm
(),
1.0
e
-
6
);
}
public
static
Test
suite
()
{
return
new
TestSuite
(
SpinStabilizedTest
.
class
);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment