Search found 2968 matches

by Richard
May 05, 2007 13:47
Forum: General
Topic: Arithmetic problem (floating point)
Replies: 23
Views: 3215

I did not mean to scare you. If you always display your results with a fixed number of decimal places then you will not notice the variation in precision. Make the number of decimal places displayed fixed initially at say 2 or 4. You will only be aware of problems if you do not control the number of...
by Richard
May 05, 2007 10:17
Forum: General
Topic: Arithmetic problem (floating point)
Replies: 23
Views: 3215

The approximate 15 digit limit for double precision specifies the total number of significant digits displayed no matter where the decimal point lies. When you multiply or divide two numbers you retain the total of 15 digits through the calculation. If you add or subtract (as you are in the example)...
by Richard
May 04, 2007 23:55
Forum: General
Topic: Arithmetic problem (floating point)
Replies: 23
Views: 3215

With any advanced calculator you need to control the number of digits displayed and the rounding. Take a look at the “Format” and the “Print Using” commands. They will give you the features you need.
by Richard
May 03, 2007 3:33
Forum: General
Topic: Identification of source.BAS version.
Replies: 2
Views: 1116

Identification of source.BAS version.

I want to avoid having to guess and manually change the compiler command –lang option in my FBIde. I could invent a new extension for my modified QB4.5 sources and possibly yet another for new FB. This gets messy as .BAS is the default for all IDEs. I’d like to avoid that change. I could put a line ...
by Richard
May 02, 2007 20:32
Forum: General
Topic: Let's Have Some Fun
Replies: 52
Views: 9710

Randomize Timer:Dim As Double i=200,j,a=.2+2*Rnd,b=0.3+2*Rnd,c=-13-4*Rnd,x,y,xx,yy Screen 21:Window(-240,-i)-(i,i) a:For i=1 To 2e4:Pset(x+y,x-y),j:xx=y-Sgn(x)*Sqr(Abs(a*x-b)):yy=c-x:x=xx:y=yy:Next i j+=1:If j>15 Then j=0 If Inkey$ = "" Then...
by Richard
May 02, 2007 15:10
Forum: General
Topic: Let's Have Some Fun
Replies: 52
Views: 9710

Life is a game, the aim of which is to discover the rules of the game.
We now know the rules, what is the cool idea?
by Richard
Apr 30, 2007 10:36
Forum: General
Topic: Polygon Challenge
Replies: 26
Views: 4452

There is no flaw in either code, you just moved the goal posts. You had not fully specified the problem. If the fence line has ends then your fence posts can mark them. The question that then rises is how to determine if the fence post is inside or outside the polygon. You have the maths needed to s...
by Richard
Apr 29, 2007 22:56
Forum: General
Topic: Polygon Challenge
Replies: 26
Views: 4452

Holes in polygons are separate polygons themselves. Holes subtract from the outer polygon area.
Run the algorithm on the outer polygon, then run it again on the hole, using the same fence line. Subtract the hole areas from the outer areas. There you have it.
by Richard
Apr 29, 2007 22:45
Forum: General
Topic: Polygon Challenge
Replies: 26
Views: 4452

Counting_pine wrote: I received no comments on it at all. I still don't understand why. Although you did post the first working solution to the problem, you received no comments when you originally posted your algorithm because no one trusted or understood how it worked. It was too advanced for the ...
by Richard
Apr 29, 2007 0:47
Forum: General
Topic: Polygon Challenge
Replies: 26
Views: 4452

Once upon a time we would have cut the polygon out of sheet material, cut along the fence line and then weighed or compared the two parts on a beam balance. Counting pixels is quicker but not as fast and accurate as vector maths solutions which take on the order of 50 usec for this example. Interest...
by Richard
Apr 26, 2007 16:24
Forum: General
Topic: Polygon Challenge
Replies: 26
Views: 4452

I have edited my code and documentation to fix and clean it up a bit. It also now plots the polygons. I would first like to thank duke4e and Sisophon2001 for their praise. Secondly I would not have done it if such an apparently simple problem had not been posed clearly. Luckily I needed something to...
by Richard
Apr 25, 2007 13:03
Forum: General
Topic: Polygon Challenge
Replies: 26
Views: 4452

The problem is soluble. By selecting a vector method and avoiding triangulation the solution is fairly simple, just lots of clear thinking. This method here solves the problem. It ignores the empty area in the top polygon while connecting the two separate areas below with a zero width channel. Anyho...
by Richard
Apr 25, 2007 3:31
Forum: Beginners
Topic: Declare Function with passed array
Replies: 8
Views: 1539

D.J.Peters, Thanks for that. To put the empty brackets in to specify an array needs any dummy variable name. The word array seems to work and makes the meaning obvious.
So simple.

Code: Select all

Declare Function two( As Integer, array() As Double) As Double
by Richard
Apr 25, 2007 3:02
Forum: Beginners
Topic: Declare Function with passed array
Replies: 8
Views: 1539

Declare Function with passed array

I am having trouble finding out how to write a "Declare Function" statement that specifies an array as a passed parameter. The following code runs ok but if I uncomment the "Declare Function two(... " line it gives me "error 55, type missmatch" at the "Function two(..." line later on. How should I w...
by Richard
Apr 20, 2007 3:01
Forum: General
Topic: Image Rotation
Replies: 7
Views: 2196

you have not assigned values of cx and cy to x and y inside the loop

Go to advanced search