Metadata-Version: 2.4
Name: geokits
Version: 0.4.8
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Rust
Classifier: Topic :: Scientific/Engineering :: GIS
Classifier: Topic :: Scientific/Engineering :: Mathematics
Classifier: Topic :: Scientific/Engineering :: Oceanography
Classifier: Operating System :: OS Independent
Summary: Professional geospatial & maritime computational utilities
Author-email: GeoKit Dev Team <dev@geokit.tech>
Requires-Python: >=3.12
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM

# geokits

Professional geospatial and maritime computational utilities.

Built with Rust and PyO3 for Python 3.12+.

## Installation

```bash
pip install maturin
maturin develop --release
```

Or build a wheel:

```bash
maturin build --release
pip install target/wheels/geokits-*.whl
```

## Usage

```python
import geokits

# 创建计算器：排水量(m³), 船长(m), 船宽(m), 吃水(m)
calc = geokits.NavCalc(
    displacement=50000.0,
    length=200.0,
    breadth=30.0,
    draught=10.0,
)

# 设置航速（节）和装载状态（True=满载，False=压载）
calc.setup(speed_kts=12.0, laden=True)

# 计算综合失速（节）：风向角, 蒲福风级, 浪高, 浪向角
speed_loss = calc.compute(
    wind_beta=20.0,      # 风向角（度）
    wind_scale=6,        # 蒲福风级 0~12
    wave_height=4.0,     # 浪高（米）
    wave_beta=15.0,      # 浪向角（度）
)
print(f"失速: {speed_loss:.2f} 节")
```

## API

### `geokits.NavCalc(displacement, length, breadth, draught)`

创建船舶计算器实例。

| 参数 | 类型 | 说明 |
|------|------|------|
| `displacement` | `float` | 排水量 (m³)，必须 > 0 |
| `length` | `float` | 船长 (m)，必须 > 0 |
| `breadth` | `float` | 船宽 (m)，必须 > 0 |
| `draught` | `float` | 吃水 (m)，必须 > 0 |

### `NavCalc.setup(speed_kts, laden)`

设置航速和装载状态，自动重新计算内部参数。

| 参数 | 类型 | 说明 |
|------|------|------|
| `speed_kts` | `float` | 航速（节） |
| `laden` | `bool` | `True` 满载，`False` 压载 |

### `NavCalc.compute(wind_beta, wind_scale, wave_height, wave_beta) -> float`

计算风浪综合失速值（节）。负值表示减速。

| 参数 | 类型 | 说明 |
|------|------|------|
| `wind_beta` | `float` | 风向角（度） |
| `wind_scale` | `int` | 蒲福风级 0~12 |
| `wave_height` | `float` | 浪高（米） |
| `wave_beta` | `float` | 浪向角（度） |

## Development

```bash
# 运行测试
cargo test

# 构建并安装到当前 Python 环境
maturin develop
```

