TrendFlowThe TrendFlow_VolHub is a clean, trend-following indicator built on a simple yet effective core of Exponential Moving Averages (EMAs). It provides clear visual cues for trend direction, volatility, and key support/resistance levels.
Key Features
Dynamic EMA Ribbon (21/50):
The area between the EMA 21 and EMA 50 is filled with color to clearly visualize the short-term trend momentum.
Green Fill: EMA 21 is above EMA 50 (Bullish Momentum).
Red Fill: EMA 21 is below EMA 50 (Bearish Momentum).
A user-adjustable Fill Opacity input (0-100) is included for customization.
Dynamic EMA 200 (Long-Term Filter):
The EMA 200 serves as a powerful long-term trend filter and major support/resistance.
Its color dynamically changes based on its position relative to the EMA 21 and EMA 50:
Teal/Green: EMA 200 is below both the 21 and 50 (Strong Bullish Alignment).
Red/Maroon: EMA 200 is above both the 21 and 50 (Strong Bearish Alignment).
Gray: The EMAs are crossing or choppy (Neutral/Consolidation).
Suggested Use
Trend Confirmation: Use the Ribbon color (Green/Red) to confirm the immediate directional bias.
Trend Strength: Use the EMA 200 color as a high-level filter. A bullish ribbon (green) combined with a teal/green 200 EMA suggests a high-conviction uptrend.
Dynamic S/R: The EMA lines themselves can be used as dynamic support and resistance levels.
Индикаторы и стратегии
Dual ATR Trailing Stop with Buy/Sell SignalsThis indicator applies two ATR-based trailing stops (Fast and Slow) together with a four-state market classifier to visualize trend strength and place crossover Buy/Sell markers. It is a trend-following tool and does not predict future prices. Use it alongside independent analysis and risk management.
How it works
The Fast trail uses ATR with period 5 and multiplier 0.5 by default. The Slow trail uses ATR with period 10 and multiplier 3.0 by default. When price remains above the prior trail, the new trail equals the maximum of the previous trail and close minus the stop-loss distance derived from ATR. When price remains below the prior trail, the new trail equals the minimum of the previous trail and close plus that distance. On a side switch the trail is re-anchored from the current bar. The Fast trail reacts more quickly, while the Slow trail aims to confirm direction and filter noise.
Signals
Buy is when the Fast trail crosses above the Slow trail. Sell is when the Fast trail crosses below the Slow trail. These crossovers are continuation cues rather than standalone trade advice.
Four-state coloring
Strong Bull occurs when Fast is above Slow, the close is above Slow, and the low is above Slow. Bull with Pullback occurs when Fast is above Slow and the close is above Slow, but the low dips below Slow. Strong Bear occurs when Slow is above Fast, the close is below Slow, and the high is below Slow. Bear with Bounce occurs when Slow is above Fast and the close is below Slow, but the high pierces above Slow.
Directional bias
Bias is inferred by comparing which of Strong Bull or Strong Bear occurred more recently using a barsSince comparison. The most recent state defines the current bias and can help filter frequent flips in ranges.
Inputs
You can adjust Fast ATR period from 1 to 50 and its multiplier from 0.1 to 5.0. You can adjust Slow ATR period from 1 to 50 and its multiplier from 0.1 to 10.0. Optional toggles control candle coloring, trail visibility, fill between trails, alerts, and the information panel.
On-chart outputs
The indicator plots the Fast trail and the Slow trail, with optional fill between them. It can show Buy and Sell markers at crossovers. The optional information panel can display last signal side, entry price, current price, P&L since last signal, current market state, Fast and Slow ATR values, and inferred bias.
Alerts
Available alerts are Fast crossing above Slow, Fast crossing below Slow, entering Strong Bull, and entering Strong Bear.
Usage guidelines
For trend following, many users wait for a Buy crossover together with Strong Bull coloring and then manage risk against the Slow trail. For scalping, consider lower timeframes and a smaller Fast ATR such as period 3 and multiplier 0.3, while avoiding over-optimization. When publishing screenshots, use a clean chart with the symbol, timeframe, and the indicator’s name visible.
Limitations and realism
The tool works best in directional markets; ranging conditions may cause frequent side switches. It is designed for standard OHLC charts only and is not intended for Heikin Ashi, Renko, Kagi, Point & Figure, or Range charts. No claims are made about accuracy, profits, or future performance. Always use position sizing, stop-losses, and additional confirmation.
Compatibility and version
Pine Script v6. Default inputs in the publication match the values described above. Version 1.0 initial public release.
Notes
For questions and feedback, please use the comments section on the script page.
COMBINED VOLUMECombined Volume indicator with custom Coloring, takes the volume from all exchanges, for forex, crypto, or stocks and tags it against the volume on your current exchange
Midnight Resistance & Support Resistance Support Zones With Bullish And Bearish Candle Breakout Signals
Final BestSmart Strategy - NajamInsya Allah Win Rate 70% Up
script ini sudah memasukkan bebrabagai indikator
Jesse 1-op-left IndicatorA structure-break (BOS) tool that marks high-quality breaks and draws sticky separator boxes you can trade from. It’s built for intraday session work and stays lightweight and clear by default.
Final BestSmart Strategy - NajamWin Rate > 70 % Insya ALlah
script ini sudah mencakup bebrabagai indikator
Spike Volume Bar & POCThis indicator identifies volume spikes using Z-score statistical analysis and
calculates Point of Control (POC) for high-volume bars.
KEY FEATURES:
- Statistical volume spike detection using customizable Z-score threshold
- Multi-timeframe POC calculation using lower timeframe data
- Multiple volume sources (Chart, Binance, Coinbase, Bybit, OKEx)
- Smart POC line management with hit detection
- Color-coded bars for bullish/bearish high-volume periods
HOW IT WORKS:
1. Z-SCORE CALCULATION:
• Calculates rolling mean and standard deviation of volume over specified period
• Z-score = (Current Volume - Mean Volume) / Std Deviation
• Triggers when Z-score exceeds threshold (default: 2.0σ)
2. POC CALCULATION:
• For lower timeframe mode: analyzes intrabar volume distribution
• Calculates VWAP for each lower timeframe bar
• Identifies price level with highest volume concentration
• Uses statistical filtering (Z-score > 1.5) to find volume clusters
3. LINE MANAGEMENT:
• Draws horizontal lines at POC levels
• Extends lines until price touches them
• Optional: hides or grays out touched POC levels
• Maintains up to 500 active lines
UNIQUE FEATURES:
- Combines statistical volume analysis with micro-structure POC calculation
- Multi-timeframe volume profiling within single bars
- Flexible volume data sourcing for cross-exchange analysis
- Dynamic line management prevents chart clutter
USE CASES:
- Identify institutional activity and volume clusters
- Find high-probability support/resistance from volume profile
- Scalping entries at POC levels during pullbacks
- Confirmation of breakouts with volume spikes
Rolling VWAP (7D/30D/90D/365D)This indicator calculates Volume-Weighted Average Price (VWAP) across multiple
rolling time periods: 7 days, 30 days, 90 days, and 365 days.
KEY FEATURES:
- Multi-timeframe VWAP calculation using hourly and daily data
- Automatic data source selection for stablecoin pairs (USDT/USDC/USD)
- Intelligent fallback system: attempts Binance data first, then uses current chart
- Three display modes: Lines, Bands (with volatility ranges), and Horizontal Lines
- Customizable colors, labels, and text for all timeframes
HOW IT WORKS:
- VWAP = Σ(Typical Price × Volume) / Σ(Volume) over specified period
- For 7D/30D/90D: uses 60-minute intervals (168/720/2160 bars)
- For 365D: uses daily intervals
- Bands mode adds ±5% standard deviation ranges around VWAP
- Updates in real-time for Lines/Bands modes
- Updates on confirmed bars for Horizontal Lines mode
UNIQUE FEATURES:
- Smart data sourcing with automatic Binance/chart fallback for crypto pairs
- Multiple display modes in one indicator
- Rolling periods (not anchored to specific dates)
- Optimized for both liquid and illiquid trading pairs
USE CASES:
- Identify fair value zones across multiple timeframes
- Mean reversion trading strategies
- Support/resistance levels based on volume profile
- Long-term trend analysis with 365D VWAP
Combo COT + Valuation Index 1. COT Report (Commitments of Traders)
Based on CFTC’s weekly COT reports showing open positions of different market participant groups.
Displays Net Positions of 3 trader groups:
Commercials (hedgers, smart money)
Large Speculators (non-commercials)
Small Speculators (non-reportables)
Pulls data from the COT Legacy Report
Option to display short positions as negative values
📊 Use case:
Track what the major players are doing
Spot potential market reversals based on positioning shifts
📈 2. COT Index
Calculates COT Index (0–100 scale) for each group, normalized over a chosen historical period
Available for:
Commercials
Non-commercials
Non-reportables
Customizable lookback (e.g., 26, 52, 78 weeks)
🧠 Interpretation:
Index near 100: group is heavily long (possible reversal soon)
Index near 0: group is heavily short
📊 3. Seasonality Forecast
Forecasts price behavior based on historical seasonal trends
Modes:
Daily seasonality (day of year)
Weekly seasonality (week of year)
Monthly seasonality (month of year)
Uses multi-year historical data (up to 15 years) to generate average trend
Option to display a smooth seasonality line extended into the future
📆 Use case:
Anticipate seasonal uptrends/downtrends
Combine with technical analysis for optimal entries
💸 4. Valuation Index
Compares the current asset’s performance against major benchmark assets:
DXY
GOLD
BOND
BTC
Normalizes relative return to a score from –100 to +100
📊 Displays relative valuation such as:
DXY Value
GOLD Value
BOND Value
📈 Use case:
Identify whether an asset is overvalued or undervalued
Use macro valuation to support trade decisions
🧠 Key Highlights
All-in-one tool: Combines multiple advanced analytics in one script
Flexible dashboard interface with mode switching via dropdown
Ideal for traders using:
Positioning analysis (smart money flows)
Macro/fundamental overlays
Seasonal market cycles
📌 Practical Applications
Trade forex, commodities, crypto, or any asset with available COT data
Spot smart money shifts to position early
Combine with price action or indicators to confirm entries
noname_899//@version=6
// Purpose: Draw dynamic support/resistance levels using a monotonic stack of highs/lows
MTF EMA IndicatorThis indicator is a tool that supports trend-following strategies using multi-timeframe EMAs and Perfect Order. It automatically displays entry and exit signals based on Heikin-Ashi pattern recognition. Compatible with all timeframes (1min to Daily) and can be used on Heikin-Ashi charts. Works with various instruments including Gold (XAUUSD) and Forex currency pairs.
このインジケーターは、複数時間足のEMAとパーフェクトオーダーを使用したトレンドフォロー手法をサポートするツールです。平均足のパターン判定により、エントリー・決済シグナルを自動表示します。あらゆる時間足(1分足~日足)に対応し、平均足チャートでも使用可能です。ゴールド(XAUUSD)やFX通貨ペアなど、様々な銘柄で利用できます。
EMA Panel — 7/12/21 vs 147 (Cross-Over Marks + ALL) (Misu)Full Technical Description
Overview:
The EMA Subpanel — Cross-Over Tracker (7/12/21 vs 147) is designed to visualize multi-layer EMA dynamics in a dedicated subwindow, separating it from price candles.
It focuses on identifying momentum shifts and medium-term trend transitions based on interactions between short-term and long-term exponential moving averages (EMAs).
Core Logic:
Plots four EMAs: 7, 12, 21, and 147 periods on a separate panel.
Marks every crossover event where EMA7, EMA12, or EMA21 moves above EMA147.
Once all three short-term EMAs (7, 12, 21) are above EMA147 (either sequentially or simultaneously), the script labels the bar with “ALL(7/12/21 > 147)”, indicating a potential strong bullish structure.
When any of the short-term EMAs crosses below EMA147, the system resets the tracking state and waits for a new crossover sequence.
Usage Notes:
This indicator does not overlay price candles (it runs in a separate panel).
Traders can use the “ALL” signal as confirmation of multi-timeframe bullish alignment.
The logic can be inverted or expanded to detect bearish phases (e.g., “ALL”) by mirroring the crossover conditions.
Works well as a trend confirmation filter alongside price action, BOS/CHoCH structure, or volume-based models.
Alerts:
Custom alert conditions are included for:
Each individual EMA crossover above EMA147.
The completion of the full 3-line alignment (ALL event).
1m RSI NQ StrategyNQ Momentum Strategy — 1-Minute Framework
This strategy is designed for Nasdaq futures (NQ) and other highly correlated instruments such as MNQ and QQQ on short-term timeframes, particularly the 1-minute chart.
It combines RSI-based momentum detection, trend filtering through moving averages, and a volume confirmation component to identify high-probability reversal or continuation setups.
The approach focuses on capturing intraday momentum while managing risk through strict trade closure before the session ends.
Core Concepts:
1. Momentum signals: Triggered when RSI reaches overbought or oversold conditions.
2. Trend filter: Uses moving averages to ensure entries align with the dominant market bias.
3. Volume factor: Adds confirmation to filter out low-quality breakouts.
4. Repaint reduction: Incorporates 'barstate.isconfirmed' logic to minimize false or shifting signals.
4. Session management: All positions are automatically closed before session end — optimized for day trading.
Testing Summary
The framework was evaluated over October 2024 – October 2025 and demonstrated stable results and consistent signal behavior across various market phases.
Contract size: 1
The 485 trades responded consistently to RSI overbought/oversold conditions
Usage Notes:
Recommended market: NQ, MNQ, QQQ
Recommended timeframe: 1 minute
Ideal use case: Intraday and short-term trading
Please note that results may vary depending on broker data, execution latency, and personal settings. Past performance does not guarantee future returns.
Educational and research purposes only.
VRI VVI Highlighter x Smart Black GirlPurpose: a modern, visually clean indicator built to help traders identify VRI (Volume Reversal Index) and VVI (Volume Volatility Index) confirmations directly on the price chart—designed with precision and style under the Smart Black Girl collection for intuitive, confident market execution.
Core Function
Calculates VRI to detect when price and volume diverge, signaling hidden accumulation or distribution.
Calculates VVI to measure volatility strength relative to trading volume, confirming when a move has real market energy behind it.
Highlights candles where both indicators align with the market trend.
Visual Output
Green candles & upward arrows = bullish VRI/VVI confirmation.
Red candles & downward arrows = bearish VRI/VVI confirmation.
Each signal bar prints labels showing exact VRI and VVI values, keeping the chart informative and clear.
Subtle color tones maintain a professional aesthetic suitable for dark or light chart themes.
Logic
Trend filter: EMA8 vs EMA20.
Volatility filter: active only when VVI exceeds its rolling average.
Signal trigger:
Bull → VRI crosses above 0 with trend_up + volatility_active.
Bear → VRI crosses below 0 with trend_down + volatility_active.
Use Case
Ideal for traders who want to visually confirm momentum shifts without chart noise. Works well on 5m–30m timeframes for momentum entries or reversal setups.
Non-Repainting
Signals only appear after the bar closes, ensuring reliability for live or back tested analysis.
Mag 3 Indicator3 Indicators for the chart itself containing a custom color code, Moving averages and Support Resistance Zones
Trading Gorilla Entry ConfirmationTrading Gorilla Entry Confirmation with the use of price action and candle sticks behavior.
MTP - Precision Killzone 10%/90%/WINPrecision Killzone Indicator – A Data-Driven Candle Killzone Analysis Tool
The Precision Killzone Indicator is designed to help traders identify potential momentum zones based on the relationship between current and previous candle ranges. By highlighting when price action reaches the upper or lower thresholds (90% or 10%) of the prior candle, it aims to provide users with a structured approach to spotting potential continuation or reversal areas.
🔍 Key Features
90/10 Candle Zone Detection
Detects when the high or low of the current candle breaches the 90% or 10% level of the previous candle's range. This can be used to identify moments of strong momentum or potential exhaustion.
Historical Outcome Tracking
Allows users to define profit target parameters (e.g., 1:1, 1:2, or custom). The indicator then calculates historical outcome rates based on those settings.
Real-Time Visual Zones
Displays potential high-probability areas on the chart using colored zones — for example, green for possible opportunity zones and red for caution areas. These zones help traders visually interpret recent price behavior.
Multi-Timeframe Support
Works across various chart timeframes, enabling analysis from short-term scalping or intraday setups to longer-term swing trading perspectives.
Performance Dashboard
Shows aggregated statistics such as signal count, win rate (based on your chosen parameters), and pip-based results — directly on the chart for easy monitoring.
Custom Alerts & Webhook Compatibility
Set alerts when price enters specific candle zones. Supports webhook functionality for integrating with automation platforms if desired.
🧠 Objective Use Case
This tool does not generate buy/sell recommendations or guarantee performance outcomes. It is intended to assist with technical analysis by providing visual and statistical insights into how price interacts with dynamic candle zones. Traders should always combine this tool with their own strategies, market understanding, and risk management processes.
⚠️ Disclaimer
This indicator is a technical analysis tool and should be used for informational and educational purposes only. It does not constitute financial advice or guarantee any specific trading results. Past performance metrics generated by the tool are based on historical price action and do not predict future outcomes. Users are solely responsible for any trading decisions made.
📌 Note to Reviewers:
This script contains no external links, marketing content, or financial guarantees. All statistical references are user-configurable and calculated from historical chart data.
Conviction Ratio | viResearchConviction Ratio | viResearch
Conceptual Foundation and Innovation
The Conviction Ratio by viResearch is a trend strength indicator designed to measure the conviction behind market movements by analyzing price returns over a defined period. It reflects how consistently and powerfully an asset has trended within that time window. The higher the ratio, the stronger and more confident the trend.
This approach provides a clear and intuitive way to gauge whether recent price action is supported by genuine momentum or merely short-term noise. By quantifying return intensity, the indicator helps traders identify assets that are trending with conviction versus those moving without sustained direction.
Technical Composition and Calculation
The Conviction Ratio evaluates an asset’s performance by comparing its current price level to past values over a customizable lookback period. It measures how much the market has advanced or declined, translating that movement into a normalized ratio that reflects overall trend conviction.
A rising ratio indicates strong and accelerating trend strength, while a falling or negative ratio suggests fading momentum or potential reversal. This dynamic view helps traders visually assess whether a trend is strengthening, weakening, or entering a transition phase.
Features and User Inputs
To accommodate different trading styles and timeframes, the indicator offers several adjustable settings:
Period (Days): Defines how far back the indicator measures return performance, allowing users to analyze short-term bursts or longer-term trends.
Start Date: Sets the beginning of the analysis window, useful for backtesting or focusing on a specific time period.
The Conviction Ratio line changes color dynamically to reflect market conviction:
Aqua: Positive ratio, indicating strong upward trend strength.
Pink: Negative ratio, signaling weak or declining market conviction.
Practical Applications
The Conviction Ratio can be applied across all asset classes — equities, cryptocurrencies, forex, and commodities — to identify where the strongest trends are forming. It’s particularly useful for:
Measuring Trend Strength: Quickly determine how strong or sustained a trend is within the chosen timeframe.
Identifying Momentum Shifts: Spot when market conviction is increasing or fading, signaling potential trend continuation or reversal.
Comparative Analysis: Compare multiple assets to find which ones are trending with greater conviction and consistency.
Advantages and Strategic Value
The Conviction Ratio offers a simple yet powerful way to quantify trend quality. Instead of relying on price direction alone, it evaluates the strength and persistence behind that movement. This makes it an ideal tool for trend followers, momentum traders, and portfolio managers seeking to align with assets showing genuine directional confidence.
Its normalized structure ensures consistency across different volatility environments, making it suitable for both discretionary and systematic trading strategies.
Visual Cues and Interpretation
The indicator plots a smooth, color-coded ratio line centered around zero, with key reference levels at +1.0 and –1.0.
Ratios above +1.0 indicate strong, confident uptrends.
Ratios below +1.0 suggest weakening or unstable market conditions.
Ratios below 0 represent unprofitable or negative-return periods.
Sharp declines in the ratio, even from high positive levels, can serve as early warning signals of weakening momentum or potential trend reversal.
By tracking both the level and the rate of change of the ratio, traders can detect when market conviction starts to fade — often before price itself shows clear reversal signs.
Summary and Usage Tips
The Conviction Ratio | viResearch provides traders with a clean, data-driven way to interpret market strength. By focusing on return-based trend conviction, it highlights where the market is moving with genuine confidence and warns when conviction begins to erode.
Use it to confirm breakout strength, identify fading rallies, or monitor early signs of trend exhaustion. The higher the ratio, the stronger the conviction — but when it starts falling sharply, take note. It might be your first signal that the trend is losing strength.
Note: Historical results are for reference only and do not guarantee future performance.
ORDER BLOCKSThis indicator automatically detects and visualizes bullish and bearish order blocks using swing-based price action logic.
It’s designed for traders who focus on market structure, displacement, and institutional-style footprints (ICT-style logic) — without the clutter of overlapping or stale zones.
🧩 Core Logic
- Swing Structure Detection
- Identifies swing highs and lows using left/right candle logic to isolate structural turning points.
- Order Block Detection
- Bullish OB forms when price displaces upward after a swing low, confirming demand imbalance.
- Bearish OB forms when price displaces downward after a swing high, confirming supply imbalance.
- Mitigation Logic (Close-Through Deletion)
- Blocks remain active until price closes fully through the opposite side, at which point they’re considered mitigated and removed.
- No Overlap Enforcement
- Ensures order blocks never overlap in price range. When a new OB overlaps an older one, the older block is automatically deleted to keep the chart clean and structurally accurate.
⚙️ Features
- Customizable Swing Sensitivity (Left/Right Bars)
- Adjust how many candles define a swing high or low.
- Adjustable Lookback Range (Scan Back Bars)
- Determines how far back the script looks for valid OB setups.
- Dynamic OB Management
- Automatically extends valid blocks and removes broken ones.
- Visual Options
- Custom colors for bullish/bearish OBs and text labels showing candle range (%).
🧠 Trading Use
- Bullish OBs highlight potential demand zones or areas of institutional accumulation.
- Bearish OBs highlight potential supply zones or areas of institutional distribution.
- Once price closes through an OB, it’s considered mitigated — meaning the imbalance has been filled.
- Non-overlapping logic keeps only the most relevant, active zones for clean structure-based analysis.
📈 Ideal For
- ICT-style traders
- Smart money concepts (SMC)
- Price action structure traders
- Scalpers or swing traders using imbalance-based confluence
Thai Gold 96.5% (THB/บาททอง) อินดิเคเตอร์นี้คำนวณ “ราคาทองแท่ง 96.5% หน่วยบาทไทยต่อบาททอง”
จากราคาทองโลก (XAU/USD) และอัตราแลกเปลี่ยน (USD/THB) แบบเรียลไทม์
ช่วยให้เห็นความเคลื่อนไหวทองคำไทยอย่างแท้จริง
This indicator converts global gold prices (XAU/USD) and the USD/THB exchange rate
into real-time Thai gold bar prices (96.5% purity, THB per Baht of gold).
Visualize how global gold trends and currency moves drive Thailand’s gold market
— perfect for traders, investors, and analysts tracking the Thai precious metals market.
AlgebraGeoLibraryLibrary "AlgebraGeoLibrary"
Algebra & 2D geometry utilities absent from Pine built-ins.
Rigorous, no-repaint, export-ready: vectors, robust roots, linear solvers, 2x2/3x3 det/inverse,
symmetric 2x2 eigensystem, orthogonal regression (TLS), affine transforms, intersections,
distances, projections, polygon metrics, point-in-polygon, convex hull (monotone chain),
Bezier/Catmull-Rom/Barycentric tools.
clamp(x, lo, hi)
clamp to
Parameters:
x (float)
lo (float)
hi (float)
near(a, b, atol, rtol)
approximately equal with relative+absolute tolerance
Parameters:
a (float)
b (float)
atol (float)
rtol (float)
sgn(x)
sign as {-1,0,1}
Parameters:
x (float)
hypot(x, y)
stable hypot (sqrt(x^2+y^2))
Parameters:
x (float)
y (float)
method length(v)
Namespace types: Vec2
Parameters:
v (Vec2)
method length2(v)
Namespace types: Vec2
Parameters:
v (Vec2)
method normalized(v)
Namespace types: Vec2
Parameters:
v (Vec2)
method add(a, b)
Namespace types: Vec2
Parameters:
a (Vec2)
b (Vec2)
method sub(a, b)
Namespace types: Vec2
Parameters:
a (Vec2)
b (Vec2)
method muls(v, s)
Namespace types: Vec2
Parameters:
v (Vec2)
s (float)
method dot(a, b)
Namespace types: Vec2
Parameters:
a (Vec2)
b (Vec2)
method crossz(a, b)
Namespace types: Vec2
Parameters:
a (Vec2)
b (Vec2)
method rotate(v, ang)
Namespace types: Vec2
Parameters:
v (Vec2)
ang (float)
method apply(v, T)
Namespace types: Vec2
Parameters:
v (Vec2)
T (Affine2)
affine_identity()
identity transform
affine_translate(tx, ty)
translation
Parameters:
tx (float)
ty (float)
affine_rotate(ang)
rotation about origin
Parameters:
ang (float)
affine_scale(sx, sy)
scaling about origin
Parameters:
sx (float)
sy (float)
affine_rotate_about(ang, px, py)
rotation about pivot (px,py)
Parameters:
ang (float)
px (float)
py (float)
affine_compose(T2, T1)
compose T2∘T1 (apply T1 then T2)
Parameters:
T2 (Affine2)
T1 (Affine2)
quadratic_roots(a, b, c)
Real roots of ax^2 + bx + c = 0 (numerically stable)
Parameters:
a (float)
b (float)
c (float)
Returns: with n∈{0,1,2}; r1<=r2 when n=2.
cubic_roots(a, b, c, d)
Real roots of ax^3+bx^2+cx+d=0 (Cardano; returns up to 3 real roots)
Parameters:
a (float)
b (float)
c (float)
d (float)
Returns: (valid r2/r3 only if n>=2/n>=3)
det2(a, b, c, d)
det2 of
Parameters:
a (float)
b (float)
c (float)
d (float)
inv2(a, b, c, d)
inverse of 2x2; returns
Parameters:
a (float)
b (float)
c (float)
d (float)
solve2(a, b, c, d, e, f)
solve 2x2 * = via Cramer
Parameters:
a (float)
b (float)
c (float)
d (float)
e (float)
f (float)
det3(a11, a12, a13, a21, a22, a23, a31, a32, a33)
det3 of 3x3
Parameters:
a11 (float)
a12 (float)
a13 (float)
a21 (float)
a22 (float)
a23 (float)
a31 (float)
a32 (float)
a33 (float)
inv3(a11, a12, a13, a21, a22, a23, a31, a32, a33)
inverse 3x3; returns
Parameters:
a11 (float)
a12 (float)
a13 (float)
a21 (float)
a22 (float)
a23 (float)
a31 (float)
a32 (float)
a33 (float)
eig2_symmetric(a, b, d)
symmetric 2x2 eigensystem: [ , ]
Parameters:
a (float)
b (float)
d (float)
Returns: with unit eigenvectors
tls_line(xs, ys)
Orthogonal (total least squares) regression line through point cloud
Input arrays must be same length N>=2. Returns line in normal form n•x + c = 0
Parameters:
xs (array)
ys (array)
Returns: where (nx,ny) unit normal; (cx,cy) centroid.
orient(a, b, c)
orientation (signed area*2): >0 CCW, <0 CW, 0 collinear
Parameters:
a (Vec2)
b (Vec2)
c (Vec2)
project_point_line(p, a, d)
project point p onto infinite line through a with direction d
Parameters:
p (Vec2)
a (Vec2)
d (Vec2)
Returns: where proj = a + t*d
closest_point_segment(p, a, b)
closest point on segment to p
Parameters:
p (Vec2)
a (Vec2)
b (Vec2)
Returns: where t∈ on segment
dist_point_line(p, a, d)
distance from point to line (infinite)
Parameters:
p (Vec2)
a (Vec2)
d (Vec2)
dist_point_segment(p, a, b)
distance from point to segment
Parameters:
p (Vec2)
a (Vec2)
b (Vec2)
intersect_lines(p1, d1, p2, d2)
line-line intersection: L1: p1+d1*t, L2: p2+d2*u
Parameters:
p1 (Vec2)
d1 (Vec2)
p2 (Vec2)
d2 (Vec2)
Returns:
intersect_segments(s1, s2)
segment-segment intersection (closed segments)
Parameters:
s1 (Segment2)
s2 (Segment2)
Returns: where kind: 0=no, 1=proper point, 2=overlap (ix/iy=na)
circumcircle(a, b, c)
circle through 3 non-collinear points
Parameters:
a (Vec2)
b (Vec2)
c (Vec2)
intersect_circle_line(C, p, d)
intersections of circle and line (param p + d t)
Parameters:
C (Circle2)
p (Vec2)
d (Vec2)
Returns: with n∈{0,1,2}
intersect_circles(A, B)
circle-circle intersection
Parameters:
A (Circle2)
B (Circle2)
Returns: with n∈{0,1,2}
polygon_area(xs, ys)
signed area (shoelace). Positive if CCW.
Parameters:
xs (array)
ys (array)
polygon_centroid(xs, ys)
polygon centroid (for non-self-intersecting). Fallback to vertex mean if area≈0.
Parameters:
xs (array)
ys (array)
point_in_polygon(px, py, xs, ys)
point-in-polygon test (ray casting). Returns true if inside; boundary counts as inside.
Parameters:
px (float)
py (float)
xs (array)
ys (array)
convex_hull(xs, ys)
convex hull (monotone chain). Returns array of hull vertex indices in CCW order.
Uses array.sort_indices(xs) (ascending by x). Ties on x are handled; result is deterministic.
Parameters:
xs (array)
ys (array)
lerp(a, b, t)
linear interpolate between a and b
Parameters:
a (float)
b (float)
t (float)
bezier2(p0, p1, p2, t)
quadratic Bezier B(t) for points p0,p1,p2
Parameters:
p0 (Vec2)
p1 (Vec2)
p2 (Vec2)
t (float)
bezier3(p0, p1, p2, p3, t)
cubic Bezier B(t) for p0,p1,p2,p3
Parameters:
p0 (Vec2)
p1 (Vec2)
p2 (Vec2)
p3 (Vec2)
t (float)
catmull_rom(p0, p1, p2, p3, t, alpha)
Catmull-Rom interpolation (centripetal form when alpha=0.5)
t∈ , returns point between p1 and p2
Parameters:
p0 (Vec2)
p1 (Vec2)
p2 (Vec2)
p3 (Vec2)
t (float)
alpha (float)
barycentric(A, B, C, P)
barycentric coordinates of P wrt triangle ABC
Parameters:
A (Vec2)
B (Vec2)
C (Vec2)
P (Vec2)
Returns:
point_in_triangle(A, B, C, P)
point-in-triangle using barycentric (boundary included)
Parameters:
A (Vec2)
B (Vec2)
C (Vec2)
P (Vec2)
Vec2
Fields:
x (series float)
y (series float)
Line2
Fields:
p (Vec2)
d (Vec2)
Segment2
Fields:
a (Vec2)
b (Vec2)
Circle2
Fields:
c (Vec2)
r (series float)
Affine2
Fields:
a (series float)
b (series float)
c (series float)
d (series float)
tx (series float)
ty (series float)






















