Click here to Skip to main content
15,895,709 members
Home / Discussions / C#
   

C#

 
AnswerRe: hello guys I have a Question, how to display the result from this program in richtextbox when I push a buttom Pin
OriginalGriff21-Feb-16 5:23
mveOriginalGriff21-Feb-16 5:23 
Questionbest practice for run-time transforming large data set of high-precision values Pin
BillWoodruff20-Feb-16 18:14
professionalBillWoodruff20-Feb-16 18:14 
AnswerRe: best practice for run-time transforming large data set of high-precision values Pin
Garth J Lancaster20-Feb-16 19:02
professionalGarth J Lancaster20-Feb-16 19:02 
GeneralRe: best practice for run-time transforming large data set of high-precision values Pin
BillWoodruff20-Feb-16 19:21
professionalBillWoodruff20-Feb-16 19:21 
AnswerRe: best practice for run-time transforming large data set of high-precision values Pin
Pete O'Hanlon20-Feb-16 23:41
mvePete O'Hanlon20-Feb-16 23:41 
GeneralRe: best practice for run-time transforming large data set of high-precision values Pin
Kenneth Haugland22-Feb-16 2:56
mvaKenneth Haugland22-Feb-16 2:56 
GeneralRe: best practice for run-time transforming large data set of high-precision values Pin
Pete O'Hanlon22-Feb-16 3:30
mvePete O'Hanlon22-Feb-16 3:30 
AnswerRe: best practice for run-time transforming large data set of high-precision values Pin
Luc Pattyn21-Feb-16 11:57
sitebuilderLuc Pattyn21-Feb-16 11:57 
Hi Bill,

1.
From your list, given such a task, I would instinctively go for TransformPoints(), although I haven't ever used it.

2.
However.
Lacking contextual info, it is unclear to me why you would have a PointF[] array in the first place. A PointF[] may of course be a popular parameter type in the API's you are using, if not I would think twice before introducing it.

2a.
If this is a graphical WinForms application, surely PointF[] are sometimes useful. However chances are the transformations provided by the Graphics class could do the job you need done, unless drastic downscaling would cause way too many irrelevant points to be drawn.

2b.
"All" the points of a circle can be generated rather cheaply by algorithmic rotation, using something like:
xNext = x*cos(alpha) - y*sin(alpha);
yNext = y*cos(alpha) + x*sin(alpha);

where alpha is the angular step you want to use to step the circle's circumference. Obviously you need to calculate cos(alpha) and sin(alpha) only once, so each point would cost 4 muls + 2 adds, to be weighed against disk accesses and memory usage.

2b.PS: yes, this iterative approach will accumulate rounding errors; it may well be acceptable for a few hundred/thousand points on your circle. And using double rather than float probably wouldn't increase the cost at all.

2c.
A circle being extremely symmetrical, if you decide to store circular points anyhow, you could consider only storing one eight of a circle (say everything from 0 to 45 degrees). Then, having separate x[] and y[] arrays may prove easier than a single PointF[].

2c.PS: and when you store one eight of a circle, you should consider dealing with the eight points that belong together in a single go, before stepping to the next 8-tuple.


Hope any of this is relevant to you.

Smile | :)
Luc Pattyn [My Articles] Nil Volentibus Arduum


modified 21-Feb-16 18:13pm.

QuestionFileSystemWatcher Problem Pin
Kevin Marois19-Feb-16 5:26
professionalKevin Marois19-Feb-16 5:26 
AnswerRe: FileSystemWatcher Problem Pin
Richard MacCutchan19-Feb-16 5:39
mveRichard MacCutchan19-Feb-16 5:39 
GeneralRe: FileSystemWatcher Problem Pin
Kevin Marois19-Feb-16 5:45
professionalKevin Marois19-Feb-16 5:45 
GeneralRe: FileSystemWatcher Problem Pin
Richard MacCutchan19-Feb-16 5:47
mveRichard MacCutchan19-Feb-16 5:47 
AnswerRe: FileSystemWatcher Problem Pin
Pete O'Hanlon19-Feb-16 5:52
mvePete O'Hanlon19-Feb-16 5:52 
GeneralRe: FileSystemWatcher Problem Pin
Kevin Marois19-Feb-16 5:54
professionalKevin Marois19-Feb-16 5:54 
AnswerRe: FileSystemWatcher Problem Pin
Luc Pattyn19-Feb-16 7:24
sitebuilderLuc Pattyn19-Feb-16 7:24 
GeneralRe: FileSystemWatcher Problem Pin
CHill6019-Feb-16 8:56
mveCHill6019-Feb-16 8:56 
GeneralRe: FileSystemWatcher Problem Pin
Garth J Lancaster20-Feb-16 18:37
professionalGarth J Lancaster20-Feb-16 18:37 
AnswerRe: FileSystemWatcher Problem Pin
Garth J Lancaster20-Feb-16 18:42
professionalGarth J Lancaster20-Feb-16 18:42 
AnswerRe: FileSystemWatcher Problem Pin
Gerry Schmitz21-Feb-16 9:11
mveGerry Schmitz21-Feb-16 9:11 
GeneralRe: FileSystemWatcher Problem Pin
Kevin Marois22-Feb-16 6:30
professionalKevin Marois22-Feb-16 6:30 
GeneralRe: FileSystemWatcher Problem Pin
Gerry Schmitz22-Feb-16 6:57
mveGerry Schmitz22-Feb-16 6:57 
GeneralRe: FileSystemWatcher Problem Pin
Kevin Marois22-Feb-16 7:01
professionalKevin Marois22-Feb-16 7:01 
GeneralRe: FileSystemWatcher Problem Pin
Gerry Schmitz22-Feb-16 7:33
mveGerry Schmitz22-Feb-16 7:33 
GeneralRe: FileSystemWatcher Problem Pin
Kevin Marois22-Feb-16 7:43
professionalKevin Marois22-Feb-16 7:43 
GeneralRe: FileSystemWatcher Problem Pin
Gerry Schmitz22-Feb-16 8:09
mveGerry Schmitz22-Feb-16 8:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.