📋 Overview
This file is a utility software that performs turning trajectory calculations for trucks (heavy vehicles and semi-trailers). It accurately calculates the minimum aisle width, clearance, and coordinates of various parts of the vehicle body when turning, and visually draws the trajectory diagram.
- Aisle width design in logistics facilities
- Calculation of turning space for on-site roads
- Verification of parking lot and yard design
- Optimization of cargo handling space
- Ensuring safe vehicle traffic lines
🔧 Dependencies
Uses the EPPlus library to read truck specification data from Excel files.
🎯 Key Features
1. Truck Trajectory Calculation Feature
- Supports various vehicle types (2t to heavy trucks, semi-trailers)
- Calculation of inner wheel difference during turning
- Calculation of overhang (front and rear protrusion)
- Automatic calculation of clearance (required aisle width)
2. Precise Calculation using Trigonometry
- Coordinate calculation of various vehicle parts using trigonometric functions
- Mutual conversion between angles and radians
- Calculation of distance (radius) from the center of rotation
- Verification function for multiple calculation methods
3. Visualization Features
- Drawing of truck turning trajectory diagrams
- Display of vehicle body dimension diagrams
- Switchable display of explanatory diagrams
- Display of magnified and overall views
📊 Supported Vehicle Types
| Vehicle Type | Description | Use Case |
|---|---|---|
| 2T Standard Cab Standard Body | Light Truck | Urban delivery, small-scale logistics |
| 2T Wide Cab Long Body | Light Truck (Long) | Long item / multi-load delivery |
| 2T Wide Cab Super Long Body | Light Truck (Super Long) | High-capacity delivery |
| 4T Cargo Wide Full Cab | Medium Truck (Wide) | Mid-distance transport |
| 4T Cargo Standard Width Full Cab | Medium Truck (Standard) | General medium delivery |
| 16T Cargo 6x2 | Heavy Truck (3-axle) | Mass transport |
| 15T Cargo 8x4 | Heavy Truck (4-axle) | Heavy goods transport |
| 11T Cargo Front Dual Axle | Heavy Truck (Front dual) | Special heavy goods |
| 20ft Container Truck | Dedicated for 20ft containers | International logistics, port transport |
| 40ft Container Truck | Dedicated for 40ft containers | Large-scale international logistics |
🔍 Main Methods Details
1. Form Load Processing
Initialization Process:
- Display expiration date and copyright
- Check existence of required files
- Load truck dimension data
- Load semi-trailer dimension data
- Set up vehicle type selection combobox
- Set default screen values
- Initial settings for trigonometric calculations
2. Start Calculation Processing
Calculation Flow:
- Apply setting values (if necessary)
- Load screen data
- Calculate truck body coordinates
- Calculate clearance
- Adjust truck scale dimensions
- Calculate stop position before turning
- Draw straight and turning trajectory
- Visual feedback (change background color)
3. Truck Body Coordinate Calculation
Calculation Items:
- Front Wheel Center Coord: Reference point for turning
- Rear Wheel Center Coord: Base point for inner wheel difference calc
- Vehicle Front End Coord: Overhang calculation
- Vehicle Rear End Coord: Rear clearance
- Four Corners Coord: Calculation of trajectory envelope
- Minimum Turning Radius: Evaluation of turning performance
4. Clearance Calculation
Calculation Details:
- Inner Clearance: Minimum width due to inner wheel difference
- Outer Clearance: Required width on the outside of the body
- Total Aisle Width: Minimum width for safe turning
- Front Overhang: Protrusion amount of the front end
- Rear Overhang: Protrusion amount of the rear end
5. Trajectory Diagram Drawing
Drawing Elements:
- Drawing of vehicle outline (Rectangle)
- Turning trajectory of front/rear wheels (Arcs)
- Trajectory of the four corners (Envelope)
- Towing pin position (For semi-trailers)
- Display of aisle width
- Display of clearance
📐 Trigonometric Calculations
Basic Theory of Calculation
The truck trajectory calculation heavily uses the following trigonometric functions:
Basic Trigonometric Functions
cos(θ) = Adjacent / Hypotenuse
tan(θ) = Opposite / Adjacent
Inverse Trigonometric Functions
θ = arccos(x / r) ← Find angle from x and r
θ = arctan(y / x) ← Find angle from y and x
Pythagorean Theorem
x = √(r² - y²)
y = √(r² - x²)
Implemented Calculation Functions
| Function Name | Calculation Details | Return Value |
|---|---|---|
| X_CoordinateCalc1(Angle, r) | Calculate x coord from angle and r | x = cos(Radians) × r |
| X_CoordinateCalc3(r, y) | Calculate x coord from r and y | x = √(r² - y²) |
| Y_CoordinateCalc1(Angle, r) | Calculate y coord from angle and r | y = sin(Radians) × r |
| R_CoordinateCalc3(y, x) | Calculate radius r from x and y | r = √(x² + y²) |
| RadianCalc1(r, y) | Calculate radian from r and y | θ = arcsin(y / r) |
| RadianCalc4(Angle) | Calculate radian from angle | Radian = (π / 180) × Angle |
| AngleCalc(Radian) | Calculate angle from radian | Angle = (180 / π) × Radian |
Execution of Trigonometric Calculations
Calculation Steps:
- Calculation of Point P1 (1st Quadrant)
- Calculate x from r and y
- Calculate radian and angle
- Calculation of P1 at Landing (2nd Quadrant)
- Calculate landing angle with 180° - Angle
- The x-coordinate is negative in the 2nd quadrant
- Calculation of Point P2 (Landing -15°)
- Subtract 15° from landing angle
- Calculate new coordinates
- Calculation of Point P3 (Position after moving)
- Add offset (xs, ys) from P1
- Calculate new radius and angle
- Calculation of Point P4 (P3 -15°)
- Subtract 15° from P3 angle
- Calculate final coordinates
📥 Data Loading
1. Truck Dimension Data
Loaded Data:
- Vehicle Name
- Total Length
- Total Width
- Wheelbase (Vehicle Pitch)
- Front Wheel Tread
- Rear Wheel Tread
- Front Overhang
- Rear Overhang
- Minimum Turning Radius
Sheet Name: TruckTrajectoryData
DataGridView: TruckDimensionDgv
2. Semi-Trailer Dimension Data
Loaded Data:
- Tractor Dimensions
- Trailer Dimensions
- Connection Part Dimensions
- Towing Pin Position
- Turning Characteristic Data
Sheet Name: SemiTrailerTrajectoryData
DataGridView: SemiTrailerDimensionDgv
🎨 UI Components
Input Parameters
| Control | Description | Use Case |
|---|---|---|
| VehicleTypeSelectCb | Vehicle type selection combobox | Select truck for calculation |
| CenterCoordXTb, YTb | Coordinates of the turning center | Adjust drawing position |
| VehiclePitchTb | Wheelbase | Base value for turning calc |
| ScaleTb | Scale of the drawing | Adjust drawing size |
| StraightTb | Straight distance | Straight length before turning |
Inputs for Trigonometric Calc
| Control | Description |
|---|---|
| Radius_rTb | Radius (Hypotenuse) |
| yTb | y-coordinate (Opposite) |
| xsTb, ysTb | Moving distance (Offset) |
| HypotenuseTb | Length of hypotenuse |
| OppositeTb | Length of opposite side |
| AdjacentTb | Length of adjacent side |
RadioButtons (Display Switching)
- BodyDimensionDiagramRb: Displays explanatory diagram of body dimensions
- CalcExplanationDiagram1Rb: Turning aisle width diagram 1
- CalcExplanationDiagram2Rb: Turning aisle width diagram 2
- CalcExplanationDiagram3Rb: Detailed turning aisle width diagram
- SettingValueRb: Automatically sets default values
- OverallDiagramRb / MagnifiedDiagramRb: Toggles clearance diagram view
PictureBox (Image Display)
- BodyPb: Displays body dimensions and explanatory diagrams
- ClearanceBetweenVehicles2Pb: Explanatory diagram for clearance
- RotationPb: Drawing canvas for the truck trajectory diagram
DataGridView
- TruckDimensionDgv: Displays truck spec data
- SemiTrailerDimensionDgv: Displays semi-trailer spec data
- CoordinateCalcDgv: Displays coordinate calculation results
- TrigonometricTableDgv: Trigonometric calculation results
Buttons
- CalcStartBt: Execute trajectory calculation
- Trigonometric_ExplanationStartBt: Execute trigonometric calculation
- Explanation2AExecuteBt: Detailed trigonometric calculation
- TrigonometricTable_ReDisplayBt: Redisplay trigonometric table
- CloseBt: Close the form
🖼️ Image Resources
The following JPG images are used as explanatory diagrams:
| File Name | Description |
|---|---|
| BodyDimensionDiagram2.jpg | Dimension diagram of truck body parts |
| TruckTurningAisleWidth1.jpg | Basic diagram of turning aisle width |
| TruckTurningAisleWidth2.jpg | Detailed diagram of turning aisle width |
| TruckTurningAisleWidth2-1.jpg | Overall clearance diagram |
| TruckTurningAisleWidth2-2.jpg | Magnified clearance diagram |
📐 Calculation Example: Turning Aisle Width
Step 1: Front Wheel Turning Radius
Step 2: Rear Wheel Turning Radius
Step 3: Turning Radius of Body Outer Point
Step 4: Turning Radius of Body Inner Point
Step 5: Required Aisle Width
🔍 Special Processing
1. Scale Adjustment
Scales the truck dimensions to fit the drawing canvas size. Adjustable via the scale parameter.
2. Default Value Setting by Vehicle Type
Automatically sets optimal drawing parameters (center coordinates, scale, straight distance) depending on the selected vehicle type.
| Vehicle Type | Scale | Straight Distance | Vehicle Pitch |
|---|---|---|---|
| 2T Standard | 0.02 | 1600mm | 3000mm |
| 2T Long | 0.02 | 2900mm | 3000mm |
| 4T Cargo | 0.02 | 4250~4500mm | 3000mm |
| Heavy Truck | 0.02 | 5450~5600mm | 4000mm |
3. Calculation of Stop Position Before Turning
Calculates the truck's stop position before starting the turn and draws the vehicle in a straight state.
🎯 Visual Feedback
Changing GroupBox Background Color
When executing a calculation, the background color of GroupBox4 alternates:
- LightYellow: Calculation executing state
- PowderBlue: Normal state
GroupBox4.BackColor = Color.LightYellow
CalcStart_Chk2 = 1
Else
GroupBox4.BackColor = Color.PowderBlue
CalcStart_Chk2 = 0
End If
🔧 DataGridView Settings
Common Settings
- RowHeadersVisible = False: Hide row headers
- ColumnHeadersVisible = False: Hide column headers
- AllowUserToAddRows = False: Disable user row addition
- ReadOnly = True: Read-only mode
- Frozen: Freeze first row/column
Cell Styles
| Style | Settings |
|---|---|
| cstyle1 | Alignment = MiddleCenter |
| cstyle2 | Alignment = MiddleRight, Format = "N0" |
| cstyle3 | Alignment = MiddleRight, Format = "N1" |
Column Width Settings
- Column 1 (Vehicle Name): Width 110px
- Other Columns: Width 50px
📊 Generation of Trigonometric Table
Displays the results of trigonometric calculations as a list:
Display Items
- Angle (0° to 360°)
- Radian
- sin value
- cos value
- tan value
Can be utilized for verification of engineering calculations or educational purposes.
📐 Implemented Trigonometric Methods
Coordinate Calculation Functions
| Method | Description | Formula |
|---|---|---|
| X_CoordinateCalc1(Angle, r) | X coord from angle and radius | x = r × cos(Angle in radians) |
| X_CoordinateCalc3(r, y) | X coord from radius and Y coord | x = √(r² - y²) |
| Y_CoordinateCalc1(Angle, r) | Y coord from angle and radius | y = r × sin(Angle in radians) |
| R_CoordinateCalc3(y, x) | Radius from X and Y coords | r = √(x² + y²) |
Angle / Radian Conversion Functions
| Method | Description | Formula |
|---|---|---|
| RadianCalc1(r, y) | Radian from radius and Y coord | θ = arcsin(y / r) |
| RadianCalc4(Angle) | Radian from angle | Radian = Angle × π / 180 |
| AngleCalc(Radian) | Angle from radian | Angle = Radian × 180 / π |
🎨 Graphics Drawing
Drawing Methods Used
- Graphics.DrawLine: Drawing straight lines (body outline)
- Graphics.DrawRectangle: Drawing rectangles (main body)
- Graphics.DrawEllipse: Drawing ellipses/circles (tires, turning trajectory)
- Graphics.DrawArc: Drawing arcs (part of turning trajectory)
- Graphics.DrawPolygon: Drawing polygons (complex shapes)
Pen Settings
Dim RPen As New Pen(Color.Red, 2) ' Red, line width 2
Dim BPen_Dash As New Pen(Color.Blue, 1)
BPen_Dash.DashStyle = DashStyle.Dash ' Dashed line
Drawing Canvas
g.Clear(RotationPb.BackColor) ' Clear canvas
' Drawing process
g.Dispose() ' Release resources
🔄 Overall Processing Flowchart
┌─────────────────────────────────────┐ │ Form Load │ └──────────┬──────────────────────────┘ │ ├→ Expiration / Copyright Display ├→ File Verification ├→ Load Truck Dimensions ├→ Load Semi-Trailer Dimensions ├→ Set VehicleTypeSelectCb ├→ Default Screen Settings └→ Initial Settings for Trig Calc │ ▼ ┌─────────────────────────────────────┐ │ Calculate Start Button Click │ └──────────┬──────────────────────────┘ │ ├→ Apply Settings (if needed) ├→ Load Screen Data │ ▼ ┌─────────────────────────────────────┐ │ Truck Body Coordinate Calc │ └──────────┬──────────────────────────┘ │ ├─ Front Wheel Center Coord ├─ Rear Wheel Center Coord ├─ Vehicle Front End Coord ├─ Vehicle Rear End Coord ├─ Four Corners Coord └─ Min Turning Radius │ ▼ ┌─────────────────────────────────────┐ │ Clearance Calculation │ └──────────┬──────────────────────────┘ │ ├─ Inner Clearance ├─ Outer Clearance ├─ Total Aisle Width ├─ Front Overhang └─ Rear Overhang │ ▼ ┌─────────────────────────────────────┐ │ Scale Adjustment │ └──────────┬──────────────────────────┘ │ ▼ ┌─────────────────────────────────────┐ │ Stop Position Before Turn Calc │ └──────────┬──────────────────────────┘ │ ▼ ┌─────────────────────────────────────┐ │ Straight & Turn Trajectory Draw │ └──────────┬──────────────────────────┘ │ ├─ Draw Body Outline ├─ Draw Front Wheel Trajectory ├─ Draw Rear Wheel Trajectory ├─ Draw Four Corners Trajectory └─ Display Aisle Width
💡 Use Cases
1. Logistics Facility Design
- Determining aisle widths in warehouses
- Optimizing dock layouts
- Arranging truck berths
2. Factory Site Design
- Determining widths of on-site roads
- Designing intersections and curves
- Ensuring safe traffic lines
3. Parking Lot Design
- Dimensions for large vehicle parking spaces
- Calculating entrance/exit widths
- Securing turning spaces
4. Education and Training
- Visual materials for driver education
- Promoting understanding of inner wheel differences
- Safe driving education
⚠️ Important Notes
Regarding Calculation Accuracy
- The calculation results are theoretical values. They may differ slightly from actual vehicle behavior.
- Tire deformation and suspension dive are not considered.
- The effects of road slope and unevenness are not included.
Safety Margin
- When designing, please add a safety margin (10-20%) to the calculated values.
- In actual operation, the driver's skill level must also be considered.
- Differences due to rainy weather or load conditions should be taken into account.
Data Updates
Truck dimension data requires periodic updates to match the latest vehicle specifications.
🔗 Related Modules
This utility can be linked with the following Tera Calculation Systems:
- T3_4 Shipping Space: Verification of truck count calculations
- Warehouse Layout Design: Confirmation of aisle width validity
- Logistics Traffic Line Planning: Safe traffic line design
📚 Summary
T3_Uty1TruckTrajectoryCalc.vb is a specialized tool that precisely calculates and visualizes the turning trajectory of trucks.
Key Features
- ✅ Supports various vehicle types (light to heavy trucks, semi-trailers)
- ✅ Precise coordinate calculation using trigonometric functions
- ✅ Automatic calculation of clearance (required aisle width)
- ✅ Visual drawing of trajectory diagrams
- ✅ Trigonometric calculation feature for learning purposes
- ✅ Display of detailed explanatory diagrams
Application Areas
- Design of logistics facilities and warehouses
- Planning of factory on-site roads
- Layout of parking lots and yards
- Driver education and safety training
📞 Support Information
Document Date: Auto-generated
Target File: T3_Uty1TruckTrajectoryCalc.vb
Language: Visual Basic .NET (VB.NET)
Total Lines: 1398 lines
Core Technologies: Windows Forms, Graphics Drawing, Trigonometric Calculations, EPPlus