Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Liang Barsky line clipping algorithm cpp code with all intermediate steps

NotificationsYou must be signed in to change notification settings

Amagnum/Liang-Barsky-line-clipping-algorithm-cpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Liang Barsky line clipping algorithm cpp code with all intermediate steps

Run

g++ liang_barsky.cpp > eliang./eliang < liang.in

Input format

Xmin Xmax Ymin YmaxP1x P1yP2x P2y

Output

p1 = -Δx = -50      q1 = x1 - x_min = -20p2 = Δx  = 50      q2 = x_max - x1 = 70p3 = -Δy = -70      q3 = y1 - y_min = -10p4 = Δy  = 70      q4 = y_max - y1 = 60for Left : Potential Enteringt = -20/-50 = 0.4for Right : Potential Leavingt = 70/50 = 1.4for Bottom : Potential Enteringt = -10/-70 = 0.142857for Top : Potential Leavingt = 60/70 = 0.857143t_min = max(0, all_t_PE) = 0.4t_max = min(1, all_t_PL) = 0.857143point corresponding to t_min :

About

Liang Barsky line clipping algorithm cpp code with all intermediate steps

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp