A Windows XP help forum. PCbanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » PCbanter forum » Windows 10 » Windows 10 Help Forum
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Calculating the aspect ratio



 
 
Thread Tools Rate Thread Display Modes
  #31  
Old June 7th 19, 05:38 PM posted to alt.comp.os.windows-10
nospam
external usenet poster
 
Posts: 4,718
Default Calculating the aspect ratio

In article , Ken Springer
wrote:

At your age, you should really not be concerned by primary school
mathematics because children are better at that and they enjoy doing
them.** I did these things when I was only 8.

The senility of that statement sill proves I'm many years younger than
you.

rude as his comment may be, he's correct. it's grade school math.

Correct, ratios and proportions are grade school math. But writing a
mathematical formula to do it with just inputting 2 variables,
apparently is not. G


true. algebra is taught in middle school.


Not necessarily. It will depend on the individual school district, and
what constitutes "middle school".


not significantly. the vast majority of students are taught algebra in
middle school, and most of them learn something from it.

figuring out aspect ratio is simple division. many grade school kids
can figure it out, with some able to write an app to do it, without
even realizing they're using algebraic concepts.

For me, the phrase "middle school" didn't exist. I don't know why
people had to change the name. LOL


because it's more than just a name change.
Ads
  #32  
Old June 7th 19, 05:38 PM posted to alt.comp.os.windows-10
nospam
external usenet poster
 
Posts: 4,718
Default Calculating the aspect ratio

In article , Ken Springer
wrote:

Now, write the math formula to do that, and remember you can only
input the 1280 and 600, or any other pair of numbers.* You do not get
to choose a common factor for input.


The basic formula is to find the GCD of two numbers and then divide the
two numbers (Numerator & Denominator) by that GCD

For example, if you have a screen size of 1152 X 864 then GCD of 1152
and 864 is 288.** (This means 288 is the highest number that can divide
both numbers exactly without leaving a remainder (or zero remainder).

Now the aspect ratio becomes:* 1152/288* :* 864/288
*this gives us: 4:3

by the way GCD stands for "Greatest Common Divisor"* and you can find
the number by plugging this in Excel:

=GCD(A1,A2)** where cell A1 is 1152, and cell A2 is 864


That's OK, but I need to go straight from 1152:864 to 4:3/


learn division.

If you want I can put a C# program online for you to play with it. It
will a an executable file made by "Good Guy"* so you need to decide
whether you want to run this program on your machine or not.


Thanks for the offer, but I need a formula that goes straight to the "end".


he *gave* you the formula.
  #33  
Old June 7th 19, 05:43 PM posted to alt.comp.os.windows-10
Mayayana
external usenet poster
 
Posts: 6,438
Default Calculating the aspect ratio

"Ken Springer" wrote

| https://eikhart.com/blog/aspect-ratio-calculator
|
| Note that the Math object is inherent to JS, so
| I'm not sure there's any universal formula there.
|
| Doesn't the math have to be built in somewhere?
|
Yes, but it's built into the javascript engine. It's a
native object. Similarly, so many webmasters now
ass jquery to their page that jquery methods also
become native. That can make it more difficult to
figure out what code is doing.

| I'd pick on his explanation in one spot, but it's no biggie.
|
I downloaded the page but it doesn't work for me.
From the code it looks like he's settling for ratios
that are not whole numbers. In other words, 2.133333:1
rather than 32:15. The former method only requires
simple division.


  #34  
Old June 7th 19, 05:45 PM posted to alt.comp.os.windows-10
Good guy
external usenet poster
 
Posts: 13
Default Calculating the aspect ratio

On 07/06/2019 17:10, Ken Springer wrote:

Not necessarily. It will depend on the individual school district,
and what constitutes "middle school".


We learned algebra in primary school except that instead of using x and
y as variables, our teacher used boxes that we were required to fill to
make a sum. The sum could be a simple addition or subtraction or
multiplication or division. We were required to think what number goes
in the box to make the equation/sum balance. IOW find the missing number!!!



For me, the phrase "middle school" didn't exist. I don't know why
people had to change the name. LOL


We just called it "primary school", "secondary school" and "high school".






--
With over 950 million devices now running Windows 10, customer
satisfaction is higher than any previous version of windows.

  #35  
Old June 7th 19, 05:48 PM posted to alt.comp.os.windows-10
Ken Springer[_2_]
external usenet poster
 
Posts: 3,817
Default Calculating the aspect ratio

On 6/7/19 10:43 AM, Mayayana wrote:
"Ken Springer" wrote

| https://eikhart.com/blog/aspect-ratio-calculator
|
| Note that the Math object is inherent to JS, so
| I'm not sure there's any universal formula there.
|
| Doesn't the math have to be built in somewhere?
|
Yes, but it's built into the javascript engine. It's a
native object. Similarly, so many webmasters now
ass jquery to their page that jquery methods also
become native. That can make it more difficult to
figure out what code is doing.

| I'd pick on his explanation in one spot, but it's no biggie.
|
I downloaded the page but it doesn't work for me.
From the code it looks like he's settling for ratios
that are not whole numbers. In other words, 2.133333:1
rather than 32:15. The former method only requires
simple division.


And 32:15 is the answer I'm looking for from any formula. No extra
steps to get that as Good Guy and nospam are suggesting.


--
Ken
MacOS 10.14.5
Firefox 67.0
Thunderbird 60.7
"My brain is like lightning, a quick flash
and it's gone!"
  #36  
Old June 7th 19, 06:09 PM posted to alt.comp.os.windows-10
Mayayana
external usenet poster
 
Posts: 6,438
Default Calculating the aspect ratio

"Ken Springer" wrote

| And 32:15 is the answer I'm looking for from any formula.

Yes. So what you want is the lowest multiplier
of the decimal ratio that results in a whole number.
I can't think of anything easier than what I wrote,
which is to step through the possibilities, unless
there's a built-in method somewhere. Either way,
it's very simple and very fast.

Though it might require
some error trapping for oddball requests. I tried
entering 1279, 331 and got "0: ". In other words,
the decimal aspect ratio could not be multiplied
by anything from 1 to 100 to get a whole number.
So I switched the loop to: For i = 1 to 1000
That returned a valid aspect ratio: 1279:331.


  #37  
Old June 7th 19, 06:31 PM posted to alt.comp.os.windows-10
Paul[_32_]
external usenet poster
 
Posts: 11,873
Default Calculating the aspect ratio

Ken Springer wrote:
On 6/7/19 4:49 AM, Ammammata wrote:
Il giorno Thu 06 Jun 2019 11:25:54p, *Ken Springer* ha inviato su
alt.comp.os.windows-10 il messaggio .
Vediamo cosa ha scritto:


https://andrew.hedges.name/experiments/aspect_ratio/



just note the Common ratios list is missing the well known 1280x1024,
typical on many monitors several years ago


It is also missing 640X480, and 1152X864. :-)



There's almost no limit to the aspect ratios possible.

Many aspect ratios will not look good, because they're
not "native resolution".

But nothing prevents a person from using a CRT when
doing aspect ratio experiments. And even if circles aren't
circles, the CRT doesn't care. Only the user cares.

Horizontal is divisible by 8, vertical divisible by 2,
for "regular" output ports. Those are typical limitations
imposed by "tradition".

When an outboard Silicon Image chip is used, the rule is
suspended, as the clock generation on an outboard digital
chip is more flexible.

The "div by 8, div by 2" rule comes from an era when

character generators were 8 bits wide
the display was potentially interleaved (div by 2)

Even back when I built my CRT5027 based framebuffer card,
the registers back then accepted the same style "modeline"
numbers as the registers do today. Including the ability
to reach any div by 8, div by 2 setup. The datasheet for the
CRT5027 was already old and crusty when I got it, so the
modeline concept was invented well before 1985.

*******

This is why 1366x768 is reachable with 1360x768,
1366x768 (only with outboard clockgen), and 1368x768.
Modern devices generally have a solution for all three,
when the computer presents one of those out of spite.
Maybe if you attempt to drive at 1360, you get "black
bars" on the side of the display, and it effectively is
running native. Or, it crops off a pixel on each side,
that sort of thing.

When 1366 first came out, the situation was a mess,
and most customers end up dissatisfied.

The 1366 is a "non-preferred" value (suitable for TV),
because it is not divisible by 8. This is why the vast
majority of all video cards, cannot make precisely the
right value. Using 1360 or 1368 can cause problems for
older displays, which have no "handling" for the workaround
cases.

The 1366x768 is used on TV sets, and the fun begins when
a TV set has a connector for "computer input". Much hair loss
occurs at that point. You would not generally find a
computer monitor at 1366x768 (unless it was a gimped TV
set being resold for computer usage).

You can use the VESA table as a "start" at "common" aspect
ratios. But, because you can also program custom values
into the video card, other goofy values that are not
ones like 4:3, 5:4, 16:9, 16:10, 21:9 could show up.

https://en.wikipedia.org/wiki/Display_aspect_ratio

I can program a video card for 936x482 and just because
it looks fuzzy on the LCD, doesn't mean it's a failure
as such. The OSD doesn't reject it. The OSD only rejects
values which are "Out Of Range".

Paul
  #38  
Old June 7th 19, 06:54 PM posted to alt.comp.os.windows-10
Paul[_32_]
external usenet poster
 
Posts: 11,873
Default Calculating the aspect ratio

Ken Springer wrote:
On 6/7/19 10:43 AM, Mayayana wrote:
"Ken Springer" wrote

| https://eikhart.com/blog/aspect-ratio-calculator
|
| Note that the Math object is inherent to JS, so
| I'm not sure there's any universal formula there.
|
| Doesn't the math have to be built in somewhere?
|
Yes, but it's built into the javascript engine. It's a
native object. Similarly, so many webmasters now
ass jquery to their page that jquery methods also
become native. That can make it more difficult to
figure out what code is doing.

| I'd pick on his explanation in one spot, but it's no biggie.
|
I downloaded the page but it doesn't work for me.
From the code it looks like he's settling for ratios
that are not whole numbers. In other words, 2.133333:1
rather than 32:15. The former method only requires
simple division.


And 32:15 is the answer I'm looking for from any formula. No extra
steps to get that as Good Guy and nospam are suggesting.


You'd be surprised where the computing is done.

A good webpage makes *your* computer do the calculatin,
using Javascript. I didn't realize this until much later,
on the "jsbeautifier" site. I thought at first, when I
pasted text into it to compute, the server was doing it.
But then I noticed "hey, there's no uploading going on",
and then a lightbulb clicked on. Instead, a mass of
Javascript code was being downloaded, and a js script
running on my own computer was doing the formatting.
Cool.

Paul


  #39  
Old June 7th 19, 07:06 PM posted to alt.comp.os.windows-10
Mayayana
external usenet poster
 
Posts: 6,438
Default Calculating the aspect ratio

"Paul" wrote

| A good webpage makes *your* computer do the calculatin,
| using Javascript. I didn't realize this until much later,
| on the "jsbeautifier" site.

I daresay I can offer something that's almost certainly
better. At one point I wanted such a tool and was very
disappointed by what they had on github. So I wrote
my own:

https://www.jsware.net/jsware/scrfiles.php5#jsdeob

Not perfect. It can sometimes choke on extremely bloated
pages, but in general it works very well. There's also an
option to translate obfuscated, script-embedded HTML.


  #40  
Old June 7th 19, 07:08 PM posted to alt.comp.os.windows-10
Mayayana
external usenet poster
 
Posts: 6,438
Default Calculating the aspect ratio

"Paul" wrote

| Prepare a ratio of the two outputs.
|
| aspect_ratio = 2*2*2*2*2*2*2*2*5 = 2*2*2*2*2 = 32
| ----------------- --------- --
| 2*2*2 *3*5 *5 3*5 15
|

I'm afraid they're going to put you in a home
if you're not careful.



  #41  
Old June 7th 19, 07:14 PM posted to alt.comp.os.windows-10
Ken Springer[_2_]
external usenet poster
 
Posts: 3,817
Default Calculating the aspect ratio

On 6/7/19 10:45 AM, Good Guy wrote:
On 07/06/2019 17:10, Ken Springer wrote:

Not necessarily.Â* It will depend on the individual school district,
and what constitutes "middle school".


We learned algebra in primary school except that instead of using x and
y as variables, our teacher used boxes that we were required to fill to
make a sum.Â* The sum could be a simple addition or subtraction or
multiplication or division.Â* We were required to think what number goes
in the box to make the equation/sum balance. IOW find the missing number!!!


I'd call that addition, not algebra. G



For me, the phrase "middle school" didn't exist.Â* I don't know why
people had to change the name.Â* LOL


We just called it "primary school", "secondary school" and "high school".


Or, elementary school, junior high school, and high school.


--
Ken
MacOS 10.14.5
Firefox 67.0
Thunderbird 60.7
"My brain is like lightning, a quick flash
and it's gone!"
  #42  
Old June 7th 19, 07:35 PM posted to alt.comp.os.windows-10
Ken Blake[_5_]
external usenet poster
 
Posts: 2,221
Default Calculating the aspect ratio

On Fri, 7 Jun 2019 10:10:28 -0600, Ken Springer
wrote:


true. algebra is taught in middle school.


Not necessarily. It will depend on the individual school district, and
what constitutes "middle school".

For me, the phrase "middle school" didn't exist.



Nor for me. Back in my day, there was Jr High School.


I don't know why
people had to change the name. LOL



Presumably because Jr High School and Middle School are not the same.
Jr High School was grades 7, 8, and 9, and Middle School is grades 6,
7, and 8.

At least that's my experience with those names. I suppose it's
possible that their meaning may vary in some locations.
  #43  
Old June 7th 19, 07:42 PM posted to alt.comp.os.windows-10
Ken Springer[_2_]
external usenet poster
 
Posts: 3,817
Default Calculating the aspect ratio

On 6/7/19 12:08 PM, Mayayana wrote:
"Paul" wrote

| Prepare a ratio of the two outputs.
|
| aspect_ratio = 2*2*2*2*2*2*2*2*5 = 2*2*2*2*2 = 32
| ----------------- --------- --
| 2*2*2 *3*5 *5 3*5 15
|

I'm afraid they're going to put you in a home
if you're not careful.


Oh, they've already thrown me out numberous times! LOL



--
Ken
MacOS 10.14.5
Firefox 67.0
Thunderbird 60.7
"My brain is like lightning, a quick flash
and it's gone!"
  #44  
Old June 7th 19, 07:45 PM posted to alt.comp.os.windows-10
Char Jackson
external usenet poster
 
Posts: 10,449
Default Calculating the aspect ratio

On Fri, 7 Jun 2019 10:48:21 -0600, Ken Springer
wrote:

On 6/7/19 10:43 AM, Mayayana wrote:
"Ken Springer" wrote

| https://eikhart.com/blog/aspect-ratio-calculator
|
| Note that the Math object is inherent to JS, so
| I'm not sure there's any universal formula there.
|
| Doesn't the math have to be built in somewhere?
|
Yes, but it's built into the javascript engine. It's a
native object. Similarly, so many webmasters now
ass jquery to their page that jquery methods also
become native. That can make it more difficult to
figure out what code is doing.

| I'd pick on his explanation in one spot, but it's no biggie.
|
I downloaded the page but it doesn't work for me.
From the code it looks like he's settling for ratios
that are not whole numbers. In other words, 2.133333:1
rather than 32:15. The former method only requires
simple division.


And 32:15 is the answer I'm looking for from any formula. No extra
steps to get that as Good Guy and nospam are suggesting.


If you have Excel, you can use something like this:

=$D1/GCD($D1,$D2) & ":" & $D2/GCD($D1,$D2)

The two values that you're checking go into cells D1 and D2 in the above
formula, but of course you can put them anywhere and just update the
formula. The formula itself can go anywhere you like, into any empty
cell.

You can add conditionals for various things, such as cases where it
spits out an aspect ratio of 8:5 when you were expecting 16:10.

  #45  
Old June 7th 19, 07:49 PM posted to alt.comp.os.windows-10
Ken Springer[_2_]
external usenet poster
 
Posts: 3,817
Default Calculating the aspect ratio

On 6/7/19 11:09 AM, Mayayana wrote:
"Ken Springer" wrote

| And 32:15 is the answer I'm looking for from any formula.

Yes. So what you want is the lowest multiplier
of the decimal ratio that results in a whole number.
I can't think of anything easier than what I wrote,
which is to step through the possibilities, unless
there's a built-in method somewhere. Either way,
it's very simple and very fast.


That's exactly the type of answer I'm looking for. But a VBScript is
not likely to work for the finished product. Ergo, a mathematical formula.

Though it might require
some error trapping for oddball requests. I tried
entering 1279, 331 and got "0: ". In other words,
the decimal aspect ratio could not be multiplied
by anything from 1 to 100 to get a whole number.
So I switched the loop to: For i = 1 to 1000
That returned a valid aspect ratio: 1279:331.


At least you match Mr. Hedges calculator! LOL


--
Ken
MacOS 10.14.5
Firefox 67.0
Thunderbird 60.7
"My brain is like lightning, a quick flash
and it's gone!"
 




Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off






All times are GMT +1. The time now is 03:22 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 PCbanter.
The comments are property of their posters.