Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
@behaver/diurnal-parallax
Advanced tools
DiurnalParallax 是一个关于天体坐标的周日视差的计算组件,可用以转换站心与地心坐标。
以月球为例,其周日视差的示意图:
通过 npm 安装,在你的 node 项目目录下执行:
npm i --save @behaver/diurnal-parallax
安装完成后,调用即可:
const DiurnalParallax = require('@behaver/diurnal-parallax');
const DiurnalParallax = require('@behaver/diurnal-parallax');
const { JDateRepository } = require('@behaver/jdate');
const SiderealTime = require('@behaver/sidereal-time');
const { SphericalCoordinate3D } = require('@behaver/coordinate/3d');
const Angle = require('@behaver/angle');
const angle = new Angle;
// 观测时间
let date = new Date('2003/08/28 11:17:00');
// 观测儒略时间
let jdate = new JDateRepository(date, 'date');
// 观测位置经纬
let obGeoLong = angle.parseDACString('116°51′50″').getDegrees();
let obGeoLat = angle.parseDACString('33°21′21″').getDegrees();
// 观测位置海拔高度,单位:千米
let obElevation = 1713;
// 观测位置恒星时对象
let siderealTime = new SiderealTime(jdate, obGeoLong);
// 天体距离,单位:AU
let r = 0.37276;
// 天体球坐标 theta 值
let theta = angle.setDegrees(90 + 15.771083).getRadian();
// 天体球坐标 phi 值
let phi = angle.setDegrees(339.530208).getRadian();
// 天体位置赤道球坐标
let gc = new SphericalCoordinate3D(r, theta, phi);
// 实例化周日视差
let dp = new DiurnalParallax({
gc,
siderealTime,
obGeoLat,
obElevation,
system: 'equinoctial',
});
// 获取站心球坐标
let tc = dp.TC;
constructor(options)
构造函数,接口同 init 方法
init(options)
初始化方法
规定参数:
set TC(tc)
设置站心球坐标对象
参数类型为 SphericalCoordinate3D 对象,规定参数球坐标中 r 值单位为:AU
get TC()
获取站心球坐标对象
set GC(gc)
设置地心球坐标对象
参数类型为 SphericalCoordinate3D 对象,规定参数球坐标中 r 值单位为:AU
get GC()
获取地心球坐标对象
The MIT license.
FAQs
The package is for calculating diurnal parallax.
We found that @behaver/diurnal-parallax demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.