What exactly is computer resolution? [closed] - resolution

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
Maybe It's a bit trivial question, but I am confused over the computer resolution. What is it?
If the resolution is say 150 X 100 then does it mean that 150 pixels will cover up the entire length of my system, (horizontally). And does it mean that the size of a pixel is not fixed? Since 300 X 200 will mean 300 pixels covering the same length.
Also, say I take up a pixel and draw a circle around it. Now is it possible that the circle passes through the centre of all the pixels it covers, or there will/can be some pixels for which the boundary does not pass through the centre. [Passing from the centre as in, if I take the extreme point on the diameter,for that the boundary passes through the centre. So like that].
That is, Can I say that taking up a pixel, if it is inside the circle or outside? [Again, the extreme point on the diameter is inside].
EDIT Also, In a normal X-Y axis; the points on the boundary are in decimals too, but if I consider the indices of pixels, in a window, then it will increase as a unit value only. So how do we decide, what all pixels get coloured when drawing a circle?

When you read 1024x768 1024 is the horizontal resolution and 768 is the vertical resolution in pixels.
A Pixel can be a square or an rectangle, its not specified.
To determine if a pixel is inside a Circle, you (simplified) calculate the distance of the center of that pixel to the center of the circle and check if it is below or equal the radius, if it is, it is inside.

Related

What is the distance in terms of millimetre between each degree on a circle?

I'm totally a beginner in Trigonometry so my question may seem so trivial for many of you.
If my understanding is correct, based on the trigonometry a degree is defined by dividing the circumference of a circle into 360 equals parts so that each of those parts is called a degree. Now imagine that you open a circle and roll it on the table to form a simple straight segment (as if you actually drew a segment on a piece of paper using a ruler). You would then have a straight segment divided by 360 equal parts. What would be the distance between each degree ( = each division) in terms of millimetre on that segment? The reason that I ask this question is that I was looking to a protractor as you can see in the picture below:
The bottom of this protractor is an ordinary ruler and above of that we can see the measures of the degrees from 0 to 180. When I compare visually the measures on the ruler on the bottom with the degrees measures on the top of the protractor, it seems that they are the same and each degree has a distance of 1 millimetre from the next or previous degree. Is this true? Sorry if the question seems somewhat trivial for many of you but I'm completely a beginner in the field and I just try to understand how these units were actually defined.
The circumference of a circle is pi * the diameter, where pi is about 3.14159.
The diameter of your protractor looks to be about 120mm, so the circumference would be about 377 mm. Dividing by 360, each degree would be 1.05 mm -- pretty close.
That's so close that I wouldn't be surprised at all if the diameter of your protractor was actually designed to be 114.6mm, just to space the degree marks out by exactly 1mm.

Interpreting analysis with PCA [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
The focus of this question is: What components should I keep?
There is a dataset that has this structure:
Each row is associated with an image in a directory.
The variable confidence is a dummy value that is always 1.
The name of the coordinates where an object is identified are: XMin, XMax, YMin, YMax.
The name of the image characteristics are: IsOccluded, IsTruncated, IsGroupOf, IsDepiction, IsInside.
So I made a correlation table, which shows below that the 4 components that correspond to the points in the image are necessary.
Then a table was made with the main components and their Explained variance ratio as shown below.
After that use PCA from sklearn and it shows the number of components and their Cumulative explained variance.
I interpret from all this that the 4 coordinates are totally necessary.
¿How Can I demonstrate that the characteristics of the image are not relevant?
the last YMin coordinate has a low percentage of Cumulative explained variance
This is wrong because the PCA gives you cumulative explained variance per principal component, not per variable of your original base.
What it tells you is that you can make a projection of the data in only 3 dimensions instead of N while still keeping 70% of the variability, while if you keep 4 dimensions you keep 80% of variability. But only after a specific change of basis (that of the PCs), not dropping some of the initial variables.
To see how important the initial variables are, you can look at the vector representation of the principal components: each of their coordinates is the amount of the corresponding initial variable that is used to make this component.
the 4 coordinates are totally necessary
It depends on your interpretation of "necessary"

right angle T in a circle - how long are the lines? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 4 years ago.
Improve this question
I was playing around with sketchup earlier and I drew this. It made me think because if you have to draw a right angled T shape in a circle to subdivide the 3 sections equally, you have to work out where the lines intersect somehow. I got this by trial and error with sketchup thanks to tweaking. It's accurate to about 3 decimal places. Original circle is 1000mm radius to keep things simple. The line that intersects the center of the circle ended up being 1264.9~. My question is why did the line end up having to be this rather odd and exact length? Each area of the circle is equal (at least according to sketchup) in mm2.
Circle with equal areas subdivided with a T:
Applications for something like this would be in areas like art and garden design where equal areas of canvas or garden need to be planted proportionately. Are there any existing examples of something like already in existence?
For a circle of radius 1, the area of a segment of aperture Θ is (Θ - sin Θ) / 2 (https://en.wikipedia.org/wiki/Circular_segment#Area). So the aperture of the lower segment is given by the transcendental equation
(Θ - sin Θ) / 2 = π / 3.
By numerical methods, Θ = 2.6053256746009...
Then the height of the two curvilinear triangles is
1 + cos Θ/2 = 1.26493208460278...
There is no closed-forma expression for this length (more than likely irrational).

How do I pad a polygon by a specified amount? [duplicate]

This question already has answers here:
An algorithm for inflating/deflating (offsetting, buffering) polygons
(15 answers)
Closed 8 years ago.
This is a question that appears to be easy, but I'm having a hard time getting it to work properly.
I have a (nonconvex) polygon defined by a list of vertices. I would like to create another polygon, where every point is shifted outward by a certain amount. I tried scaling the points and then shifting back to the original origin, but that didn't have the effect I want.
I would like for each point to be "outside" of the original point. But "outside" appears to be very difficult to compute, given only a list of points. Is there an easy way to do this?
It seems that you want an offset of the polygon, that is, the set of all points that are outside the polygon and whose distance to the polygon is some given number. The offset is not a polygon, however,
Perhaps you could just scale all vertices with respect to the centroid of the polygon.
I think you're right that inside and outside are hard to define as a global property. But with each component line segment individually, there is a clear definition of left and right (at least, within the context of traversing the path).
So, I think if you traverse your segments counter-clockwise and add segments offset to the right of the current segment, this may be close to what you want. Or traverse clockwise and add segments offset to the left. It may create degenerate shapes at concavities.

Manipulate/creation of SVGs relative to their center

I would like to identify the center of an SVG, so that I can manipulate multiple SVGs with ease.
I am trying to make multiple examples of the basic polygons (3 to 8 sides), and quickly realized that I either hade to make my own, which involves a lot of math, or I could pull from wikipedia the current ones. The problem with the former is that it takes a lot of time to translate the coordinates from Sketchup. The problem with the latter is that they are oriented differently and of different size.
I know that you can transform, scale, and rotate the SVG, but I need to know the coordinates of the center of the SVG. How do I find this out, so I can set universal manipulations?
Take the transform="rotate(degrees x y)", I need to know the center to accomplish this.
JS Fiddle
Here, I would like to set all the centers to the same, and then scale them to the same height and width, and potentially rotate them individually so that they all have a flat bottom, not a vertex.
The generic answer to your question isn't obvious...
It might be simpler for polygons, particularly convex polygons: you can iterate on the path and find its bounding box by computing the max and min of the x and y coordinates of each point of the path.
Then you can decide that the center of the shape is the center of the of the bounding box.
An alternative is to put an invisible element at what you estimate to be the center (for complex shapes, the concept of "center" can be variable), and get its coordinates to find out where the center is. Particularly for rotating purpose: you might want to do this rotation around a specific point which might not be the geometrical center.

Resources