Centroid.EU Blog
(this blog is mostly encrypted - adults only)
|
Previous Page
August 6th, 2020
No it's a rectangle! No it's two triangles!
I used squares in the past on my website to find out if someone clicked on
a circle in a HTML canvas element. This works, but it's not very rounded.
In fact the curves of the circle fall away and you're left with just a
square. I tackled this problem yesterday once and for all, and after
drawing this out I finally realised the answer.
It's not enough to measure the boundary of any dot within the area of a circle
,that is on a grid, All that is needed that you measure the distance between
two points. M and P. Where M is the center of the circle and P any arbitrary
point where you clicked. So then we analise, what is point P when M is
(X1, Y1). P is really X1 - X2, Y1 - Y2 relative to M. And it forms a square
or rectangle with one corner being M. Cut the rectangle in half you have two
triangles. But not just any triangles they are right triangles. So we can
apply Pythagoras theorem here because P could lie on R where line MP is the
hypotenuse of the triangles (either). All we need now is to get the positive
value of X1 - X2 and Y1 - Y2. Luckily computers have the abs() or fabs()
function for that.
Pythagoras theorem said: A^2 + B^2 = C^2. So we can make our formuala now:
P = sqrt(pow(fabs(Y1 - Y2), 2.0) + pow(fabs(X1 - X2), 2.0));
And if P is less or equal to the Radius of the circle, then P lies in the
circle.
So I have written a small C program to double check this and it works. The
point M in the program is at coordinates 20, 20 and you enter x, y of P and
the radius of the circle, and it will tell you if it's inside or outside of
the circle.
#include
#include
#include
#define CIRCLE_X 20.0
#define CIRCLE_Y 20.0
int
main(int argc, char *argv[])
{
double x1 = CIRCLE_X, x2;
double y1 = CIRCLE_Y, y2;
double p, r;
if (argc != 4) {
fprintf(stderr, "usage: prog x-coord y-coord radius\n");
exit(1);
}
r = atof(argv[3]); y2 = atof(argv[2]);
x2 = atof(argv[1]);
p = sqrt(pow(fabs(y1 - y2), 2.0) + pow(fabs(x1 - x2), 2.0));
if (p <= r) {
printf("With the centroid of a circle at %f, %f coordinates,"
" you clicked inside the circle\n", CIRCLE_X, CIRCLE_Y);
} else {
printf("With the centroid of a circle at %f, %f coordinates,"
"you did not click inside the circle\n",
CIRCLE_X, CIRCLE_Y);
exit (1);
}
exit (0);
}
So in any case a circle is just a square, true. No it's just a rectangle,
also true, no it's two triangles, absolutely also true! I manage this on
mediocre math skills, but it took a lot of thinking and visualizing it on
a piece of paper that's a grid. If anyone has a better formula for this
I'd love to see it! Open Mathematics!
PS: I have made a little game with
javascript. If you click on the circle it will change colour, if you miss
it it won't. Perfect trial for my formula.
0 comments
The 2018 Sabotage in Cornfields
August 5th, 2020
Around here, there was sabotage in corn fields around 2018. This is
summed up here (german) by mainpost.de.
Although they were able to get DNA data and matches, this is not a preventative
from damage and someone possibly getting hurt during harvest.
So I was wondering. Would one of those consumer drones (DJI or otherwise) be
able to be used to scan the field with a metal detector? Has someone done
anything similar? I guess someone could program a path based on GPS for the
drone to fly over the field, and someoen else gets GPS data and metal detector
signal which gets digitized (on the drone either by a soundcard sampler or
otherwise). I guess these sweeps for metal can be done at night too, just
before a harvest. Software needs to be written for this, the idea is out there.
0 comments
I have picked my project theme
July 31st, 2020
For the prototype fund (9th round) I have finalized what my project is going
to be about.
It will be improvements for delphinusdnsd like I mentioned before, but I have
a concrete picture of what I must do. I'm going to make delphinusdnsd an
authoritative nameserver for replacing Microsoft DNS server. For that I
need to do a few things: GSS-TSIG (RFC 3645), it comes with several depended
RFC's that I also have to implement like TKEY (RFC 2930) and possibly KEY RR
which comes with the SIG(0) RFC. Also I'm going to implement DNS Updates
after RFC 2136 and RFC 3007 (secured), and if there is time left in the
project time (6 months) I'll try to implement auto-signing updated records
(DNSSEC).
This is all a big task, and there is always the hindthought that Microsoft
Active Directory won't allow this. I have found a document from
Bluecat
Networks that they can do this (on a BIND9 basis). So this will be my
outline that I will be working/striving towards. Wish me luck, I'm applying
tomorrow, most likely.
0 comments
Removed CVSweb from my servers
July 28th, 2020
The day had to come, I'm thinking. If you were browsing my CVS repo on
my site I have replaced it with a GOT repo. I will reinstitute most
software on GOT when I can. CVSweb didn't do it for me anymore when it
stopped displaying commits to a branch. I will continue using the CVS
without a web interface until the delphinusdnsd 1.5.0 release at which
point I'll likely switch completely to got/git. Sorry for any inconvenience
if you were going through my repo, just at this time when I removed it.
0 comments
DMARC enabled
July 26th, 2020
I have enabled dmarc default policy (none) on this zone centroid.eu.
;; ANSWER SECTION:
_dmarc.centroid.eu. 3600 IN TXT "v=DMARC1; p=none;"
The TTL is still lower than I'd like but I'm gonna watch this for a while and
then raise it. Basically what happened is that remote mail sites would look
this up with dnssec enabled and get an NXDOMAIN with proof-of-nonexistence
which is 850 odd bytes, this default reply is only about 66 bytes and I'll
be happier posting to mailing lists, I think.
Here is a sample NXDOMAIN summary to show you it is a lot of bytes:
;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Sun Jul 26 07:53:40 CEST 2020
;; MSG SIZE rcvd: 850
Here's hoping I didn't make a calculated mistake.
0 comments
Going to try to reapply to the Prototypefund.DE this August
July 17th, 2020
When I applied to round five of the prototypefund I was in good spirits.
Then I was turned down in November 2018, it sorta pissed me off. But I'm
going to re-apply again this August for the ninth round. I'm gonna try
to get funding for this and help me get DNS Updates into delphinusdnsd,
and best of all get paid for it. Since the funding is only for half a year
starting in January, I'll have less time than allotted for
delphinusdnsd 1.6.0. So I'll have to work twice as good/fast. You can
research backwards to my original mention of this in this blog by searching
for "prototypefund" I had six hits. The website of the
prototypefund.de is here.
0 comments
Interesting article at the BBC
July 17th, 2020
I know what it feels like to be working when it's way hot, and having no
aircon. Here is an
article at
the bbc, that has an interesting chart of temperature rise since 1850.
It looks to me that since 1975 the line has been going straight up. WW2
is evident too, and by extension to the first line that goes straight up
one can draw a line from 1900 and it is similar sloped. The industrial
age has hurt us, how/when can we make amendments?
0 comments
News from delphinusdnsd
July 12th, 2020
Since I got a blog for delphinusdnsd I never talk about it here, so here is
some updates.
- 1.4.2 was released last week
- This month I'm putting forwarding (with semi-caching) functionality in it
- The last quarter of this year I'm gonna start the daunting task of
adding dynamic updates to it
The 1.5.0 release is expected to drop in December of this year. It will be
better than ever (every release gets better). I'm working toward the 1.6.0
release with dns updates, so that I can start a business around dynamic dns
updates in 2022. It would be homegrown technology not something you get off
a shelf. I'm hoping to be making a bit of money with this, which is alright
since currently I'm once again on hard times.
0 comments
Next Page
|
Search
RSS Feed
Click here for RSS
On this day in
Other links
Have feedback?
By clicking on the header of an article you will be
served a cookie. If you do not agree to this do not
click on the header. Thanks!
Using a text-based webbrowser?
... such as lynx? Welcome back it's working again for the time being.
Older Blog Entries
May, 2023
April, 2023
March, 2023
February, 2023
January, 2023
December, 2022
November, 2022
October, 2022
September, 2022
August, 2022
July, 2022
June, 2022
May, 2022
April, 2022
March, 2022
February, 2022
January, 2022
December, 2021
November, 2021
October, 2021
September, 2021
March, 2021
February, 2021
January, 2021
December, 2020
November, 2020
October, 2020
September, 2020
August, 2020
July, 2020
June, 2020
May, 2020
April, 2020
March, 2020
February, 2020
January, 2020
December, 2019
November, 2019
October, 2019
September, 2019
August, 2019
July, 2019
June, 2019
May, 2019
April, 2019
March, 2019
February, 2019
January, 2019
December, 2018
November, 2018
October, 2018
September, 2018
August, 2018
July, 2018
June, 2018
May, 2018
April, 2018
March, 2018
February, 2018
January, 2018
December, 2017
November, 2017
October, 2017
September, 2017
August, 2017
July, 2017
June, 2017
May, 2017
April, 2017
March, 2017
February, 2017
January, 2017
December, 2016
November, 2016
October, 2016
September, 2016
August, 2016
July, 2016
June, 2016
May, 2016
April, 2016
March, 2016
February, 2016
January, 2016
December, 2015
November, 2015
October, 2015
September, 2015
August, 2015
July, 2015
June, 2015
May, 2015
April, 2015
March, 2015
February, 2015
January, 2015
December, 2014
November, 2014
October, 2014
September, 2014
August, 2014
July, 2014
June, 2014
May, 2014
April, 2014
March, 2014
February, 2014
January, 2014
December, 2013
November, 2013
October, 2013
September, 2013
August, 2013
July, 2013
June, 2013
May, 2013
April, 2013
March, 2013
February, 2013
January, 2013
December, 2012
November, 2012
October, 2012
September, 2012
August, 2012
July, 2012
June, 2012
May, 2012
April, 2012
March, 2012
February, 2012
January, 2012
December, 2011
November, 2011
October, 2011
September, 2011
August, 2011
July, 2011
June, 2011
May, 2011
April, 2011
March, 2011
February, 2011
January, 2011
December, 2010
November, 2010
October, 2010
September, 2010
August, 2010
July, 2010
June, 2010
May, 2010
April, 2010
March, 2010
February, 2010
January, 2010
December, 2009
November, 2009
October, 2009
September, 2009
August, 2009
July, 2009
June, 2009
May, 2009
Powered by BCHS
|