Talk:Xiaolin Wu's line algorithm: Difference between revisions

m
added a section header to the first talk topic so that the table of contents (TOC) is in the correct place.
m (→‎REXX comment: clarified comment.)
m (added a section header to the first talk topic so that the table of contents (TOC) is in the correct place.)
 
(7 intermediate revisions by 3 users not shown)
Line 1:
== '''C#''' solution for '''Xiaolin Wu's line algorithm''' ? ==
Any guy can give me '''Xiaolin Wu's line algorithm'''s code in C#.
Than you.
Line 62 ⟶ 63:
:: Ok, but I am not sure how to tell if "floor is the required definition for 'integer part'" is the right way to characterize this issue. I took my implementation and modified the draw point routine so that it adds 100 to the coordinate before rendering to the screen. This gives me a coordinate range for my algorithm which can include negative coordinates. Then, I took my original coordinate range and subtracted 100 from every value. Then, I ran the code -- I did not see any visual artifacts resulting from this set of changes. When I look at my code, I see that I used floor to implement "integer part", but I do not know if I see no visual artifacts because I "just happened to use the right definition for integer part" or whether it's because the visual effect of this issue is too small to notice. I am also wondering whether the issue might really be that the code which extracts the fractional part has to be consistent with the code that extracts the integer part. --[[User:Rdm|Rdm]] 16:34, 4 June 2012 (UTC)
 
::: Once you make all numbers non-negative, FLOOR and IPART are synonymous. It's only when using negative numbers that the issue (any difference) is raised. -- [[User:Gerard Schildberger|Gerard Schildberger]] 16:51, 4 June 2012 (UTC)
::: Concerning another issue: FPART. When handling negative coödinates, I was wondering if FPART is doing what it's supposed to do, but I couldn't find a good definition of FPART (with regarding to negative numbers) --- but I'm still rooting around the 'net. For non-negative numbers, the simple definition of FPART (even if wrong), still gives the correct answer. FPART of 6.78 is +0.78. But what about -8.91 ? Is the fractional part +0.91 or -0.91 ? --- I'm still trying to locate a good definition for it --- I hope the definition isn't tied (or restricted to) any particular computer language. Perhaps someone could find a complete/good definition of FPART in their appropriate language reference documentation. -- [[User:Gerard Schildberger|Gerard Schildberger]] 16:46, 4 June 2012 (UTC)
 
:::: Yes, but I made some of them negative for the algorithm (just translating them to positive when they were rendered). --[[User:Rdm|Rdm]] 17:02, 4 June 2012 (UTC)
 
Concerning another issue: '''FPART'''.
 
::: Concerning another issue: FPART. When handling negative coödinates, I was wondering if FPART is doing what it's supposed to do, but I couldn't find a good definition of FPART (with regarding to negative numbers) --- but I'm still rooting around the 'net. For non-negative numbers, the simple definition of FPART (even if wrong), still gives the correct answer. FPART of 6.78 is +0.78. But what about -8.91 ? Is the fractional part +0.91 or -0.91 ? --- I'm still trying to locate a good definition for it --- I hope the definition isn't tied (or restricted to) any particular computer language. Perhaps someone could find a complete/good definition of FPART in their appropriate language reference documentation. -- [[User:Gerard Schildberger|Gerard Schildberger]] 16:46, 4 June 2012 (UTC)
 
FPART of 6.78 is +0.78. But what about -8.91 ? Is the fractional part +0.91 or -0.91 ?
 
I'm still trying to locate a good definition for it --- I hope the definition isn't tied (or restricted to) any particular computer language.
 
Perhaps someone could find a complete/good definition of FPART in their appropriate language reference documentation. -- [[User:Gerard Schildberger|Gerard Schildberger]] 16:46, 4 June 2012 (UTC)
 
: The integer part and the fractional part should add together to yield your original number. --[[User:Rdm|Rdm]] 17:03, 4 June 2012 (UTC)
 
:: Tank qew. Makes sense, concise, succent. So, -0.91 it is. -- [[User:Gerard Schildberger|Gerard Schildberger]] 17:13, 4 June 2012 (UTC)
 
== Problem In Java Code ==
 
The Java code doesn't plot the line in all directions.