Frontend Enhancements: - Complete React TypeScript frontend with modern UI components - Distributed workflows management interface with real-time updates - Socket.IO integration for live agent status monitoring - Agent management dashboard with cluster visualization - Project management interface with metrics and task tracking - Responsive design with proper error handling and loading states Backend Infrastructure: - Distributed coordinator for multi-agent workflow orchestration - Cluster management API with comprehensive agent operations - Enhanced database models for agents and projects - Project service for filesystem-based project discovery - Performance monitoring and metrics collection - Comprehensive API documentation and error handling Documentation: - Complete distributed development guide (README_DISTRIBUTED.md) - Comprehensive development report with architecture insights - System configuration templates and deployment guides The platform now provides a complete web interface for managing the distributed AI cluster with real-time monitoring, workflow orchestration, and agent coordination capabilities. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
72 lines
1.6 KiB
JavaScript
72 lines
1.6 KiB
JavaScript
var epsilon2 = 1e-12;
|
|
|
|
function cosh(x) {
|
|
return ((x = Math.exp(x)) + 1 / x) / 2;
|
|
}
|
|
|
|
function sinh(x) {
|
|
return ((x = Math.exp(x)) - 1 / x) / 2;
|
|
}
|
|
|
|
function tanh(x) {
|
|
return ((x = Math.exp(2 * x)) - 1) / (x + 1);
|
|
}
|
|
|
|
export default (function zoomRho(rho, rho2, rho4) {
|
|
|
|
// p0 = [ux0, uy0, w0]
|
|
// p1 = [ux1, uy1, w1]
|
|
function zoom(p0, p1) {
|
|
var ux0 = p0[0], uy0 = p0[1], w0 = p0[2],
|
|
ux1 = p1[0], uy1 = p1[1], w1 = p1[2],
|
|
dx = ux1 - ux0,
|
|
dy = uy1 - uy0,
|
|
d2 = dx * dx + dy * dy,
|
|
i,
|
|
S;
|
|
|
|
// Special case for u0 ≅ u1.
|
|
if (d2 < epsilon2) {
|
|
S = Math.log(w1 / w0) / rho;
|
|
i = function(t) {
|
|
return [
|
|
ux0 + t * dx,
|
|
uy0 + t * dy,
|
|
w0 * Math.exp(rho * t * S)
|
|
];
|
|
}
|
|
}
|
|
|
|
// General case.
|
|
else {
|
|
var d1 = Math.sqrt(d2),
|
|
b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1),
|
|
b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1),
|
|
r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0),
|
|
r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1);
|
|
S = (r1 - r0) / rho;
|
|
i = function(t) {
|
|
var s = t * S,
|
|
coshr0 = cosh(r0),
|
|
u = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s + r0) - sinh(r0));
|
|
return [
|
|
ux0 + u * dx,
|
|
uy0 + u * dy,
|
|
w0 * coshr0 / cosh(rho * s + r0)
|
|
];
|
|
}
|
|
}
|
|
|
|
i.duration = S * 1000 * rho / Math.SQRT2;
|
|
|
|
return i;
|
|
}
|
|
|
|
zoom.rho = function(_) {
|
|
var _1 = Math.max(1e-3, +_), _2 = _1 * _1, _4 = _2 * _2;
|
|
return zoomRho(_1, _2, _4);
|
|
};
|
|
|
|
return zoom;
|
|
})(Math.SQRT2, 2, 4);
|