text:
# *ANSWER PLEASE, NEED HELP* A rectangular pyramid is intersected by a plane to create the frustum shown.

*ANSWER PLEASE, NEED HELP* A rectangular pyramid is intersected by a plane to create the frustum shown. If the height of the original pyramid is 14 m, what is the volume of the frustum?

$*ANSWER PLEASE, NEED HELP* A rectangular pyramid is intersected by a plane to create the frustum sh$

## This Post Has 10 Comments

1. VETORRES says:

option A.which is a strong foreign relations policy was established.

2. niti1409 says:

volume of a pyramid is $\frac{lbh}3$

and frustum is actually, the top portion, i.e. a smaller pyramid taken out of the actual pyramid. so if we subtract that volume from the original volume

the leftover will be the volume of frustum

height of original pyramid is 14 and that of the remaining frustum is 8. so the height of smaller pyramid will be $14-8=6$

you can see the respective dimensions marked in the figure.

so the answer will be ${12\times 6\times 14 \over 3} - { 4\times 10 \times 6 \over 3}$ which is

24*14-80=256 m³

3. bandzswagg123 says:

8

Step-by-step explanation:

4. ScarySkyler5571 says:

52

Step-by-step explanation:

5. youdontknowme8989 says:

volume of a pyramid is $\frac{lbh}3$

and frustum is actually, the top portion, i.e. a smaller pyramid taken out of the actual pyramid. so if we subtract that volume from the original volume

the leftover will be the volume of frustum

height of original pyramid is 14 and that of the remaining frustum is 8. so the height of smaller pyramid will be $14-8=6$

you can see the respective dimensions marked in the figure.

so the answer will be ${12\times 6\times 14 \over 3} - { 4\times 10 \times 6 \over 3}$ which is

24*14-80=256 m³

6. arinegrete2003 says:

-7

Step-by-step explanation:

7. milkshakegrande101 says:

n = - $\frac{13}{8}$

Step-by-step explanation:

Given

- 8n = 13 ( divide both sides by - 8 )

n = $\frac{13}{-8}$ = - $\frac{13}{8}$

8. taylerblaylock says:

8

Step-by-step explanation:

9. pal23 says:

52 cm^2

Step-by-step explanation:

Solve by splitting the figures into 2 parts and finding their areas separately:

Rectangle:

8 × 5 = 40

Triangle:

1/2 × b × h = 1/2 × 8 × 3 = 4 × 3 = 12

Total: 40 + 12 = 52

10. angelthompson2018 says:

q < 5

Step-by-step explanation:

Since there is an open circle it means there is no equal sign

The line goes to the left so it is less then q < 5


text:
RUS  ENG JOURNALS   PEOPLE   ORGANISATIONS   CONFERENCES   SEMINARS   VIDEO LIBRARY   PACKAGE AMSBIB
 General information Latest issue Archive Search papers Search references RSS Latest issue Current issues Archive issues What is RSS

 Ural Math. J.: Year: Volume: Issue: Page: Find

 Ural Math. J., 2017, Volume 3, Issue 2, Pages 82–99 (Mi umj46)

Positive definite functions and sharp inequalities for periodic functions

Viktor P. Zastavnyi

Donetsk National University, Donetsk

Abstract: Let $\varphi$ be a positive definite and continuous function on $\mathbb{R}$, and let $\mu$ be the corresponding Bochner measure. For fixed $\varepsilon,\tau\in\mathbb{R}$, $\varepsilon\ne 0$, we consider a linear operator $A_{\varepsilon,\tau}$ generated by the function $\varphi$:
$$A_{\varepsilon,\tau}(f)(t):=\int_{\mathbb{R}}e^{-iu\tau} f(t+\varepsilon u)d\mu(u) ,\quad t\in\mathbb{R},\quad f\in C(\mathbb{T}).$$
Let $J$ be a convex and nondecreasing function on $[0,+\infty)$. In this paper, we prove the inequalities
$$\| A_{\varepsilon,\tau}(f)\|_p\leqslant \varphi(0)\|f\|_p, \quad \int_{\mathbb{T}}J(|A_{\varepsilon,\tau}(f)(t)|) dt \le \int_{\mathbb{T}}J(\varphi(0)|f(t)|) dt$$
for $p\in [1,\infty]$ and $f\in C(\mathbb{T})$ and obtain criteria of extremal function. We study in more detail the case in which $\varepsilon=1/n$, $n\in \mathbb{N}$, $\tau=1$, and $\varphi(x)\equiv e^{i\beta x}\psi(x)$, where $\beta\in\mathbb{R}$ and the function $\psi$ is $2$-periodic and positive definite. In turn, we consider in more detail the case where the 2-periodic function $\psi$ is constructed by means of a finite positive definite function $g$. As a particular case, we obtain the Bernstein–Szegő inequality for the derivative in the Weyl–Nagy sense of trigonometric polynomials. In one of our results, we consider the case of the family of functions $g_{1/n,h}(x):=hg(x)+(1-1/n-h)g(nx)$, where $n\in\mathbb{N}$, $n\ge 2$, $-1/n\le h\le 1-1/n$, and the function $g\in C(\mathbb{R})$ is even, nonnegative, decreasing, and convex on $(0,+\infty)$ with $\mathrm{supp} g\subset[-1,1]$. This case is related to the positive definiteness of piecewise linear functions. We also obtain some general interpolation formulas for periodic functions and trigonometric polynomials which include the known interpolation formulas of M. Riesz, of G. Szegő, and of A.I. Kozko for trigonometric polynomials.

Keywords: Positive definite function, Trigonometric polynomial, Weyl-Nagy derivative, Bernstein-Szegő inequality, Interpolation formula.

DOI: https://doi.org/10.15826/umj.2017.2.011

Full text: PDF file (208 kB)
Full text: https:/.../92
References: PDF file   HTML file

Bibliographic databases:

Language:

Citation: Viktor P. Zastavnyi, “Positive definite functions and sharp inequalities for periodic functions”, Ural Math. J., 3:2 (2017), 82–99

Citation in format AMSBIB
\Bibitem{Zas17} \by Viktor~P.~Zastavnyi \paper Positive definite functions and sharp inequalities for periodic functions \jour Ural Math. J. \yr 2017 \vol 3 \issue 2 \pages 82--99 \mathnet{http://mi.mathnet.ru/umj46} \crossref{https://doi.org/10.15826/umj.2017.2.011} \mathscinet{http://www.ams.org/mathscinet-getitem?mr=MR3746955} \elib{http://elibrary.ru/item.asp?id=32334102}

• http://mi.mathnet.ru/eng/umj46
• http://mi.mathnet.ru/eng/umj/v3/i2/p82

 SHARE:

Citing articles on Google Scholar: Russian citations, English citations
Related articles on Google Scholar: Russian articles, English articles

This publication is cited in the following articles:
1. V. P. Zastavnyi, A. Manov, “Positive Definiteness of Complex Piecewise Linear Functions and Some of Its Applications”, Math. Notes, 103:4 (2018), 550–564
•  Number of views: This page: 316 Full text: 86 References: 36

format: plain


text:
# Fight Finance

#### CoursesTagsRandomAllRecentScores

 Scores keithphw $6,001.61 Carolll$1,373.33 Visitor $1,258.61 cuiting$1,229.70 Jade $1,135.80 Skywalke...$1,070.00 mm11 $1,050.33 ninalee$1,039.70 Visitor $1,024.70 Zin$1,009.09 Visitor $1,005.61 Visitor$950.00 Doris $889.70 Visitor$840.00 Emma Lu $810.00 trungbin$803.09 victor $784.70 alison$771.70 Visitor $760.00 Chloe_$724.05

Jan asks you for a loan. He wants $100 now and offers to pay you back$120 in 1 year. You can borrow and lend from the bank at an interest rate of 10% pa, given as an effective annual rate.

Ignore credit risk. Remember:

$$V_0 = \frac{V_t}{(1+r_\text{eff})^t}$$

Will you or Jan's deal?

Here are the Net Income (NI) and Cash Flow From Assets (CFFA) equations:

$$NI=(Rev-COGS-FC-Depr-IntExp).(1-t_c)$$

$$CFFA=NI+Depr-CapEx - \varDelta NWC+IntExp$$

What is the formula for calculating annual interest expense (IntExp) which is used in the equations above?

Select one of the following answers. Note that D is the value of debt which is constant through time, and $r_D$ is the cost of debt.

A firm is considering a new project of similar risk to the current risk of the firm. This project will expand its existing business. The cash flows of the project have been calculated assuming that there is no interest expense. In other words, the cash flows assume that the project is all-equity financed.

In fact the firm has a target debt-to-equity ratio of 1, so the project will be financed with 50% debt and 50% equity. To find the levered value of the firm's assets, what discount rate should be applied to the project's unlevered cash flows? Assume a classical tax system.

A share just paid its semi-annual dividend of $10. The dividend is expected to grow at 2% every 6 months forever. This 2% growth rate is an effective 6 month rate. Therefore the next dividend will be$10.20 in six months. The required return of the stock 10% pa, given as an effective annual rate.

What is the price of the share now?

Details of two different types of light bulbs are given below:

• Low-energy light bulbs cost $3.50, have a life of nine years, and use about$1.60 of electricity a year, paid at the end of each year.
• Conventional light bulbs cost only $0.50, but last only about a year and use about$6.60 of energy a year, paid at the end of each year.

The real discount rate is 5%, given as an effective annual rate. Assume that all cash flows are real. The inflation rate is 3% given as an effective annual rate.

Find the Equivalent Annual Cost (EAC) of the low-energy and conventional light bulbs. The below choices are listed in that order.

A firm is considering a business project which costs $11m now and is expected to pay a constant$1m at the end of every year forever.

Assume that the initial $11m cost is funded using the firm's existing cash so no new equity or debt will be raised. The cost of capital is 10% pa. Which of the following statements about net present value (NPV), internal rate of return (IRR) and payback period is NOT correct? The following cash flows are expected: • Constant perpetual yearly payments of$70, with the first payment in 2.5 years from now (first payment at t=2.5).
• A single payment of $600 in 3 years and 9 months (t=3.75) from now. What is the NPV of the cash flows if the discount rate is 10% given as an effective annual rate? What is the present value of real payments of$100 every year forever, with the first payment in one year? The nominal discount rate is 7% pa and the inflation rate is 4% pa.

Question 892  foreign currency reserves, foreign exchange rate, no explanation

The Chinese central bank has the largest amount of foreign currency reserves.

What could the large amounts of foreign exchange reserves held by the Chinese government be used for in a currency crisis? China's currency is called the Renminbi (RMB) or Yuan (CNY). In a Chinese currency crisis the Chinese government is likely to use its FX reserves to:

The below graph from the RBA shows the phase-in of the Basel 3 minimum regulatory capital requirements under the Basel Committee on Banking Supervision (BCBS) on the left panel and in Australia under the Australian Prudential Regulatory Authority (APRA) on the right panel.

Which of the following statements about the Basel 3 minimum regulatory capital requirements as at 2019 is NOT correct? All minimum amounts exclude the 2.5% counter-cyclical buffer.

The Basel 3 minimum regulatory capital requirement as a percent of Risk Weighted Assets (RWA) is:


text:
# Month: February 2011

## Solving Ramanujan’s Puzzling Problem

Consider a sequence of functions as follows:- $f_1 (x) = \sqrt {1+\sqrt {x} }$ $f_2 (x) = \sqrt{1+ \sqrt {1+2 \sqrt {x} } }$ $f_3 (x) = \sqrt {1+ \sqrt {1+2 \sqrt {1+3 \sqrt {x} } } }$ ……and so on to $f_n (x) = \sqrt {1+\sqrt{1+2 \sqrt {1+3 \sqrt {\ldots \sqrt {1+n \sqrt {x} } } } } }$

## Its a Mystery! – Simulacrum in Eagle Nebula

This is one of the top mysteries of universe.

## Raman Effect- Raman Spectroscopy- Raman Scattering

In contrast to other conventional branches of spectroscopy, Raman spectroscopy deals with the scattering of light & not with its absorption. Raman Effect Chandrasekhar Venkat Raman discovered in 1928 that if light of a definite frequency is passed through any substance in gaseous, liquid or solid state, the light scattered at right angles contains radiations not only of the original frequency (Rayleigh Scattering)  but also of some other frequencies which are generally lower but occasionally higher than the frequency of the incident light. The phenomenon of scattering of light by a substance when the frequencies of radiations scattered at right angles are different (generally lower and only occasionally higher) from the frequency of the incident light, is known as Raman Scattering or Raman effect. The lines of lower frequencies as known as Stokes lines while those of higher frequencies are called anti-stokes lines. If $f$  is the frequency of the incident light &  $f’$  that of a particular line in the scattered spectrum, then the difference   $f-f’$  is known as the Raman Frequency. This frequency is independent of the frequency of the incident light. It is constant and is characteristic of …


text:
# Sphere of influence (astrodynamics)

A sphere of influence (SOI) in astrodynamics and astronomy is the oblate-spheroid-shaped region around a celestial body where the primary gravitational influence on an orbiting object is that body. This is usually used to describe the areas in the Solar System where planets dominate the orbits of surrounding objects such as moons, despite the presence of the much more massive but distant Sun. In the patched conic approximation, used in estimating the trajectories of bodies moving between the neighbourhoods of different masses using a two body approximation, ellipses and hyperbolae, the SOI is taken as the boundary where the trajectory switches which mass field it is influenced by.

The general equation describing the radius of the sphere ${\displaystyle r_{SOI}}$ of a planet:

${\displaystyle r_{SOI}\approx a\left({\frac {m}{M}}\right)^{2/5}}$

where

${\displaystyle a}$ is the semimajor axis of the smaller object's (usually a planet's) orbit around the larger body (usually the Sun).
${\displaystyle m}$ and ${\displaystyle M}$ are the masses of the smaller and the larger object (usually a planet and the Sun), respectively.

In the patched conic approximation, once an object leaves the planet's SOI, the primary/only gravitational influence is the Sun (until the object enters another body's SOI). Because the definition of rSOI relies on the presence of the Sun and a planet, the term is only applicable in a three-body or greater system and requires the mass of the primary body to be much greater than the mass of the secondary body. This changes the three-body problem into a restricted two-body problem.

## Table of selected SOI radii

Dependence of Sphere of influence rSOI/a on the ratio m/M

The table shows the values of the sphere of gravity of the bodies of the solar system in relation to the Sun (with the exception of the Moon which is reported relative to Earth):[1]

Mercury0.11246
Venus0.616102
Earth0.929145
Moon0.066138
Mars0.578170
Jupiter48.2687
Saturn54.51025
Uranus51.92040
Neptune86.83525

## Increased accuracy on the SOI

The Sphere of influence is, in fact, not quite a sphere. The distance to the SOI depends on the angular distance ${\displaystyle \theta }$ from the massive body. A more accurate formula is given by

${\displaystyle r_{SOI}(\theta )\approx a\left({\frac {m}{M}}\right)^{2/5}{\frac {1}{\sqrt[{10}]{1+3\cos ^{2}(\theta )}}}}$

Averaging over all possible directions we get

${\displaystyle {\overline {r_{SOI}}}=0.9431a\left({\frac {m}{M}}\right)^{2/5}}$

## Derivation

Consider two point masses ${\displaystyle A}$ and ${\displaystyle B}$ at locations ${\displaystyle r_{A}}$ and ${\displaystyle r_{B}}$, with mass ${\displaystyle m_{A}}$ and ${\displaystyle m_{B}}$ respectively. The distance ${\displaystyle R=|r_{B}-r_{A}|}$ separates the two objects. Given a massless third point ${\displaystyle C}$ at location ${\displaystyle r_{C}}$, one can ask whether to use a frame centered on ${\displaystyle A}$ or on ${\displaystyle B}$ to analyse the dynamics of ${\displaystyle C}$.

Geometry and dynamics to derive the sphere of influence

Consider a frame centered on ${\displaystyle A}$. The gravity of ${\displaystyle B}$ is denoted as ${\displaystyle g_{B}}$ and will be treated as a perturbation to the dynamics of ${\displaystyle C}$ due to the gravity ${\displaystyle g_{A}}$ of body ${\displaystyle A}$. Due their gravitational interactions, point ${\displaystyle A}$ is attracted to point ${\displaystyle B}$ with acceleration ${\displaystyle a_{A}={\frac {Gm_{B}}{R^{3}}}(r_{B}-r_{A})}$, this frame is therefore non-inertial. To quantify the effects of the perturbations in this frame, one should consider the ratio of the perturbations to the main body gravity i.e. ${\displaystyle \chi _{A}={\frac {|g_{B}-a_{A}|}{|g_{A}|}}}$. The perturbation ${\displaystyle g_{B}-a_{A}}$ is also known as the tidal forces due to body ${\displaystyle B}$. It is possible to construct the perturbation ratio ${\displaystyle \chi _{B}}$ for the frame centered on ${\displaystyle B}$ by interchanging ${\displaystyle A\leftrightarrow B}$.

Frame AFrame B
Main acceleration${\displaystyle g_{A}}$${\displaystyle g_{B}}$
Frame acceleration${\displaystyle a_{A}}$${\displaystyle a_{B}}$
Secondary acceleration${\displaystyle g_{B}}$${\displaystyle g_{A}}$
Perturbation, tidal forces${\displaystyle g_{B}-a_{A}}$${\displaystyle g_{A}-a_{B}}$
Perturbation ratio ${\displaystyle \chi }$${\displaystyle \chi _{A}={\frac {|g_{B}-a_{A}|}{|g_{A}|}}}$${\displaystyle \chi _{B}={\frac {|g_{A}-a_{B}|}{|g_{B}|}}}$

As ${\displaystyle C}$ gets close to ${\displaystyle A}$, ${\displaystyle \chi _{A}\rightarrow 0}$ and ${\displaystyle \chi _{B}\rightarrow \infty }$, and vice versa. The frame to choose is the one that has the smallest perturbation ratio. The surface for which ${\displaystyle \chi _{A}=\chi _{B}}$ separates the two regions of influence. In general this region is rather complicated but in the case that one mass dominates the other, say ${\displaystyle m_{A}\ll m_{B}}$, it is possible to approximate the separating surface. In such a case this surface must be close to the mass ${\displaystyle A}$, denote ${\displaystyle r}$ as the distance from ${\displaystyle A}$ to the separating surface.

Frame AFrame B
Main acceleration${\displaystyle g_{A}={\frac {Gm_{A}}{r^{2}}}}$${\displaystyle g_{B}\approx {\frac {Gm_{B}}{R^{2}}}+{\frac {Gm_{B}}{R^{3}}}r\approx {\frac {Gm_{B}}{R^{2}}}}$
Frame acceleration${\displaystyle a_{A}={\frac {Gm_{B}}{R^{2}}}}$${\displaystyle a_{B}={\frac {Gm_{A}}{R^{2}}}\approx 0}$
Secondary acceleration${\displaystyle g_{B}\approx {\frac {Gm_{B}}{R^{2}}}+{\frac {Gm_{B}}{R^{3}}}r}$${\displaystyle g_{A}={\frac {Gm_{A}}{r^{2}}}}$
Perturbation, tidal forces${\displaystyle g_{B}-a_{A}\approx {\frac {Gm_{B}}{R^{3}}}r}$${\displaystyle g_{A}-a_{B}\approx {\frac {Gm_{A}}{r^{2}}}}$
Perturbation ratio ${\displaystyle \chi }$${\displaystyle \chi _{A}\approx {\frac {m_{B}}{m_{A}}}{\frac {r^{3}}{R^{3}}}}$${\displaystyle \chi _{B}\approx {\frac {m_{A}}{m_{B}}}{\frac {R^{2}}{r^{2}}}}$
Hill sphere and Sphere Of Influence for _Solar system bodies.

The distance to the sphere of influence must thus satisfy ${\displaystyle {\frac {m_{B}}{m_{A}}}{\frac {r^{3}}{R^{3}}}={\frac {m_{A}}{m_{B}}}{\frac {R^{2}}{r^{2}}}}$ and so ${\displaystyle r=R\left({\frac {m_{A}}{m_{B}}}\right)^{2/5}}$ is the radius of the sphere of influence of body ${\displaystyle A}$


text:
# How do you solve x^2 + 4x + 4 = 7?

Jul 27, 2015

The solutions are:
color(green)(x=-2+sqrt(7)
color(green)( x=-2-sqrt(7)

#### Explanation:

${x}^{2} + 4 x + 4 = 7$

${x}^{2} + 4 x - 3 = 0$

The equation is of the form color(blue)(ax^2+bx+c=0 where:
$a = 1 , b = 4 , c = - 3$

The Discriminant is given by:
$\Delta = {b}^{2} - 4 \cdot a \cdot c$

 = (4)^2-(4*1*((-3))

$= 16 + 12 = 28$

The solutions are found using the formula
$x = \frac{- b \pm \sqrt{\Delta}}{2 \cdot a}$

$x = \frac{\left(- 4\right) \pm \sqrt{28}}{2 \cdot 1} = \frac{- 4 \pm 2 \sqrt{7}}{2}$

$= \frac{\cancel{2} \left(- 2 \pm \sqrt{7}\right)}{\cancel{2}}$

color(green)(x=-2+sqrt(7), x=-2-sqrt(7)


text:
## Can an Unseen Servant do things that require ability checks?

Once on each of your turns as a bonus action, you can mentally command the servant to move up to 15 feet and interact with an object. The servant can perform simple tasks that a human servant could do, such as fetching things, cleaning, mending, folding clothes, lighting fires, serving food, and pouring wine. Once you give the command, the servant performs the task to the best of its ability until it completes the task, then waits for your next command.

(PHB p. 284)

What happens if the Unseen Servant e.g. tries to steal gold out of a pocket? Or if he is commanded to pick a lock? I would consider those as “simple tasks that a human servant could do”.

Can an Unseen Servant do actions that require ability checks (apart from attacking, which is explicitely prohibited) and if yes, does the caster add his relevant modifier and proficiency bonus?

## Why do game engines define the a certain way to do things and not allow a lot of flexibility?

I understand that game engines have their own level design methods and different implementations of levels but why don’t they allow full control of the level design to the game developer? Without actually stating that, "The game developer should do/ use this to get this." rather than "Use these tools to get this done. Have full control over your product." ideology?

I guess its because not all game developers are interested in dealing with low level aspects of the game development phase but wouldn’t it be more efficient if the user can optimize certain aspects of the game to better suit for their product? For example, a mesh object, resource submissions, or other areas which game engines define a certain method?

## What’s the extent of things that a charmed creature would do for you under the effects of the *awakened* spell?

Unlike other charms, with awaken you can literally transform a beast or plant into higher-intelligence form of life. For example, an awakened tree gets to have intelligence like humans, limbs, ways to communicate and so on. It gives them freedom they never had.

Do they see the caster as their creator or something? If the caster asks the awakened tree to help in combat, or fight monsters as an ally, would they do it?

## Is it possible to lift things multiple times with different castings of reverse gravity?

My players came up with an interesting idea using reverse gravity recently which at the time I let them do because it made sense and I like to keep things flowing but wondered about the actual mechanics of it.

Reverse Gravity lifts everything centered on a point in a 50ft circle 100ft up. 2 of the players in the party had taken it, in player ones turn he cast it at ground level to lift a group of enemies the full 100 feet, the 2nd player then cast the spell a second time centering at the top of the previous spell and lifting the enemies another 100 feet. In player ones turn he stopped his version of the spell meaning player 2 could then drop them 200 feet. As there was nothing to grab hold of on the second casting there was no saving throw

At the time I was unsure if the initial casting of the spell would lock them in at 100 feet but decided to go with it. My players have also asked me if one of them could cast it repeatedly turn after turn. Effectively cancelling it as they cast it a second time lifting people multiples of 100 feet into the air before then dropping them.

Is this a DM decide situation, which I am fine with, or are there any rules stated anywhere for this situation?

## Can the spell immovable object be used to carry very heavy things?

The spell immovable object from Explorer’s Guide to Wildemount (pg. 187) says:

You touch an object that weighs no more than 10 pounds and cause it to become magically fixed in place. You and the creatures you designate when you cast this spell can move the object normally. […]

At Higher Levels. If you cast this spell using a spell slot of 4th or 5th level, the DC to move the object increases by 5, it can carry up to 8,000 pounds of weight, and the duration increases to 24 hours. If you cast this spell using a spell slot of 6th level or higher, the DC to move the object increases by 10, it can carry up to 20,000 pounds of weight, and the effect is permanent until dispelled.

The two phrases I am interested in here are:

You … can move the object normally

and,

it can carry up to 20,000 pounds of weight.

Suppose I cast immovable object at 6th level on a thin sheet of plywood. I then proceed to stack 19,999 pounds of gold ingots on top of the sheet of plywood. I then attempt to move the sheet of plywood normally.

Can an object under the effect of a 6th level immovable object spell still be moved normally while it is carrying up to 20,000 pounds?

## Can lists be defined in a special way so that they contain things of different type?

In https://www.seas.harvard.edu/courses/cs152/2019sp/lectures/lec18-monads.pdf it is written that

A type $$\tau$$ list is the type of lists with elements of type $$\tau$$

Why must a list contain elements of the same type? Why can’t it contain elements of different types?

Is there a way of defining a list polymorphically in the typed lambda calculus, so that it takes elements of any type?

Can we then use the List monad on lists, defined polymorphically?

## In Pathfinder 2e, are ability modifier benefits to things like HP and trained skills retroactive?

In Pathfinder 2e, a character’s Constitution bonus affects HP total. A character’s Intelligence bonus grants training in additional skills and languages.

Are these benefits retroactive?

Examples:

• If a character’s Constitution modifier increases from +2 to +3 as the result of an ability boost, does HP increase by 1 per character level? So a level 5 character going from +2 to +3 Con mod would gain 5 hit points for the ability score increase?
• If a character’s Intelligence modifier increases from +1 to +2 as the result of an ability boost, does that character gain another trained skill and learned language?

## How can I avoid metagaming when I know things my character doesn’t?

One common problem I run into, as a player, is having to feign not-knowing things my character doesn’t but I do, be it rules about certain creatures (“Hmm that rock golem sure looks weak against […]”), or simply some my character did not witness but I did because other players at the table had their characters there and the GM did not split the group.

For example, it can be hard to act like you don’t know your friends are in trouble in the next building, and not go over there just to have a “random look” and oh surprise find something you, as a player, already knew you’d find. Finding myself in such a situation can be avoided if the GM splits the group of players or uses other information-control tricks, but that’s not always done.

When in such a situation, what are good techniques or things I can do to force myself into an “oblivious” state of mind about those things?

How can I more easily feign ignorance of in-game/in-universe information, and have my character act with more accordance to what he knows and not what I know?

## What’s the point of things like intelligence/wisdom scores, when those are the predominantly characteristics of the player?

While I understand the role of things like strength (you can/can’t lift that), dexterity, constitution, etc. as character attributes, I really can’t make sense of intelligence/wisdom scores.

If a player notices that you can go around the monster, or just naturally has good memory, they’re going to do clever and insightful things even if they have INT/WIS of 1.

## How a Website called that perform things without requests?

How we call a website that perform things like translating or anything else, without performing an action/request or JavaScript event ?

Take for example this site, the cipher text is generated without making any requests (You can see it in the network tab in dev tools). How do we call this type of site ?


text:
• Tutorial

# Understandable RayTracing in 256 lines of bare C++

This is another chapter from my brief course of lectures on computer graphics. This time we are talking about the ray tracing. As usual, I try to avoid third-party libraries, as I believe that it makes students check what's happenning under the hood. Also check the tinykaboom project.

There are plenty of raytracing articles on the web; however the problem is that almost all of them show finished software that can be quite difficult to understand. Take, for example, the very famous businness card ray tracer challenge. It produces very impressive programs, but it's very difficult to understand how this works. Rather than showing that I can do renders, I want to tell you in detail how you can do it by yourself.

Note: It makes no sense just to look at my code, nor just to read this article with a cup of tea in hand. This article is designed for you to take up the keyboard and implement your own rendering engine. It will surely be better than mine. At the very least change the programming language!

So, the goal for today is to learn how to render such images:

# Step 1: write an image to the disk

I don't want to bother with window managers, mouse/keyboard processing and stuff like that. The result of our program will be a simple picture saved on disk. So, the first thing we need to be able to do is to save the picture to disk. Here you can find the code that allows us to do this. Let me list the main file:

#include <limits>
#include <cmath>
#include <iostream>
#include <fstream>
#include <vector>
#include "geometry.h"

void render() {
const int width    = 1024;
const int height   = 768;
std::vector<Vec3f> framebuffer(width*height);

for (size_t j = 0; j<height; j++) {
for (size_t i = 0; i<width; i++) {
framebuffer[i+j*width] = Vec3f(j/float(height),i/float(width), 0);
}
}

std::ofstream ofs; // save the framebuffer to file
ofs.open("./out.ppm");
ofs << "P6\n" << width << " " << height << "\n255\n";
for (size_t i = 0; i < height*width; ++i) {
for (size_t j = 0; j<3; j++) {
ofs << (char)(255 * std::max(0.f, std::min(1.f, framebuffer[i][j])));
}
}
ofs.close();
}

int main() {
render();
return 0;
}

Only render() is called in the main function and nothing else. What is inside the render() function? First of all, I define the framebuffer as a one-dimensional array of Vec3f values, those are simple three-dimensional vectors that give us (r,g,b) values for each pixel. The class of vectors lives in the file geometry.h, I will not describe it here: it is really a trivial manipulation of two and three-dimensional vectors (addition, subtraction, assignment, multiplication by a scalar, scalar product).

I save the image in the ppm format. It is the easiest way to save images, though not always the most convenient way to view them further. If you want to save in other formats, I recommend that you link a third-party library, such as stb. This is a great library: you just need to include one header file stb_image_write.h in the project, and it will allow you to save images in most popular formats.

Warning: my code is full of bugs, I fix them in the upstream, but older commits are affected. Check this issue.

So, the goal of this step is to make sure that we can a) create an image in memory + assign different colors and b) save the result to disk. Then you can view it in a third-party software. Here is the result:

# Step 2, the crucial one: ray tracing

This is the most important and difficult step of the whole chain. I want to define one sphere in my code and draw it without being obsessed with materials or lighting. This is how our result should look like:

For the sake of convenience, I have one commit per step in my repository; Github makes it very easy to view the changes made. Here, for instance, what was changed by the second commit.

To begin with, what do we need to represent the sphere in the computer's memory? Four numbers are enough: a three-dimensional vector for the center of the sphere and a scalar describing the radius:

struct Sphere {
Vec3f center;

Sphere(const Vec3f &c, const float &r) : center(c), radius(r) {}

bool ray_intersect(const Vec3f &orig, const Vec3f &dir, float &t0) const {
Vec3f L = center - orig;
float tca = L*dir;
float d2 = L*L - tca*tca;
t0       = tca - thc;
float t1 = tca + thc;
if (t0 < 0) t0 = t1;
if (t0 < 0) return false;
return true;
}
};

The only non-trivial thing in this code is a function that allows you to check if a given ray (originating from orig in the direction of dir) intersects with our sphere. A detailed description of the algorithm for the ray-sphere intersection can be found here, I highly recommend you to do this and check my code.

How does the ray tracing work? It is pretty simple. At the first step we just filled the picture with a gradient of colors:

    for (size_t j = 0; j<height; j++) {
for (size_t i = 0; i<width; i++) {
framebuffer[i+j*width] = Vec3f(j/float(height),i/float(width), 0);
}
}

Now for each pixel we will form a ray coming from the origin and passing through our pixel, and then check if this ray intersects with the sphere:

If there is no intersection with sphere we draw the pixel with color1, otherwise with color2:

Vec3f cast_ray(const Vec3f &orig, const Vec3f &dir, const Sphere &sphere) {
float sphere_dist = std::numeric_limits<float>::max();
if (!sphere.ray_intersect(orig, dir, sphere_dist)) {
return Vec3f(0.2, 0.7, 0.8); // background color
}
return Vec3f(0.4, 0.4, 0.3);
}

void render(const Sphere &sphere) {
￼   [...]
for (size_t j = 0; j<height; j++) {
for (size_t i = 0; i<width; i++) {
float x =  (2*(i + 0.5)/(float)width  - 1)*tan(fov/2.)*width/(float)height;
float y = -(2*(j + 0.5)/(float)height - 1)*tan(fov/2.);
Vec3f dir = Vec3f(x, y, -1).normalize();
framebuffer[i+j*width] = cast_ray(Vec3f(0,0,0), dir, sphere);
}
}
￼   [...]
}

At this point, I recommend you to take a pencil and check on paper all the calculations (the ray-sphere intersection and the sweeping of the picture with the rays). Just in case, our camera is determined by the following things:

• picture width
• picture height
• field of view angle
• camera location, Vec3f(0.0.0)
• view direction, along the z-axis, in the direction of minus infinity

Let me illustrate how we compute the initial direction of the ray to trace. In the main loop we have this formula:

            float x =  (2*(i + 0.5)/(float)width  - 1)*tan(fov/2.)*width/(float)height;
float y = -(2*(j + 0.5)/(float)height - 1)*tan(fov/2.);

Where it comes from? Pretty simple. Our camera is placed in the origin and it faces the -z direction. Let me illustrate the stuff, this image shows the camera from the top, the y axis points out of the screen:

As i said, the camera is placed at the origin, and the scene is projected at the screen that lies in the plane z = -1. The field of view specifies what sector of the space will be visible at the screen. In our image the screen is 16 pixels wide; can you compute its length in world coordinates? It is pretty simple: let us focus on the triangle formed by the red, gray and gray dashed line. It is easy to see that tan(field of view / 2) = (screen width) 0.5 / (screen-camera distance). We placed the screen at the distance of 1 from the camera, thus (screen width) = 2 tan(field of view / 2).

Now let us say that we want to cast a vector through the center of the 12th pixel of the screen, i.e. we want to compute the blue vector. How can we do that? What is the distance from the left of the screen to the tip of the blue vector? First of all, it is 12+0.5 pixels. We know that 16 pixels of the screen correspond to 2 tan(fov/2) world units. Thus, tip of the vector is located at (12+0.5)/16 2tan(fov/2) world units from the left edge, or at the distance of (12+0.5) 2/16 * tan(fov/2) — tan(fov/2) from the intersection between the screen and the -z axis. Add the screen aspect ratio to the computations and you will find exactly the formulas for the ray direction.

# Step 3: add more spheres

The hardest part is over, and now our path is clear. If we know how to draw one sphere, it will not take us long to add few more. Check the changes in the code, and this is the resulting image:

# Step 4: lighting

The image is perfect in all aspects, except for the lack of light. Throughout the rest of the article we will talk about lighting. Let's add few point light sources:

struct Light {
Light(const Vec3f &p, const float &i) : position(p), intensity(i) {}
Vec3f position;
float intensity;
};

Computing real global illumination is a very, very difficult task, so like everyone else, we will trick the eye by drawing completely non-physical, but visually plausible results. To start with: why is it cold in winter and hot in summer? Because the heating of the Earth's surface depends on the angle of incidence of the Sun's rays. The higher the sun rises above the horizon, the brighter the surface is. Conversely, the lower it is above the horizon, the dimmer it is. And after the sun sets over the horizon, photons don't even reach us at all.

Back our spheres: we emit a ray from the camera (no relation to photons!) at it stops at a sphere. How do we know the intensity of the intersection point illumination? In fact, it suffices to check the angle between a normal vector in this point and the vector describing a direction of light. The smaller the angle, the better the surface is illuminated. Recall that the scalar product between two vectors a and b is equal to product of norms of vectors times the cosine of the angle between the vectors: a*b = |a| |b| cos(alpha(a,b)). If we take vectors of unit length, the dot product will give us the intensity of surface illumination.

Thus, in the cast_ray function, instead of a constant color we will return the color taking into account the light sources:

Vec3f cast_ray(const Vec3f &orig, const Vec3f &dir, const Sphere &sphere) {
[...]
float diffuse_light_intensity = 0;
for (size_t i=0; i<lights.size(); i++) {
Vec3f light_dir      = (lights[i].position - point).normalize();
diffuse_light_intensity  += lights[i].intensity * std::max(0.f, light_dir*N);
}
return material.diffuse_color * diffuse_light_intensity;
}

The modifications w.r.t the previous step are available here, and here is the result:

# Step 5: specular lighting

The dot product trick gives a good approximation of the illumination of matt surfaces, in the literature it is called diffuse illumination. What should we do if we want to draw shiny surfaces? I want to get a picture like this:

Check how few modifications were necessary. In short, the brighter the light on the shiny surfaces, the less the angle between the view direction and the direction of reflected light.

This trickery with illumination of matt and shiny surfaces is known as Phong reflection model. The wiki has a fairly detailed description of this lighting model. It can be nice to read it side-by-side with the source code. Here is the key picture to understanding the magic:

Why do we have the light, but no shadows? It's not okay! I want this picture:

Mere six lines of code allow us to achieve this: when drawing each point, we just make sure that the segment between the current point and the light source does not intersect the objects of our scene. If there is an intersection, we skip the current light source. There is only a small subtlety: I perturb the point by moving it in the direction of normal:

Vec3f shadow_orig = light_dir*N < 0 ? point - N*1e-3 : point + N*1e-3;

Why is that? It's just that our point lies on the surface of the object, and (except for the question of numerical errors) any ray from this point will intersect the object itself.

# Step 7: reflections

It's incredible, but to add reflections to our render, we just need to add three lines of code:

    Vec3f reflect_dir = reflect(dir, N).normalize();
Vec3f reflect_orig = reflect_dir*N < 0 ? point - N*1e-3 : point + N*1e-3; // offset the original point to avoid occlusion by the object itself
Vec3f reflect_color = cast_ray(reflect_orig, reflect_dir, spheres, lights, depth + 1);

See it for yourself: when intersecting the sphere, we just compute the reflected ray (with the aid of the same function we used for specular highlights!) and recursively call the cast_ray function in the direction of the reflected ray. Be sure to play with the recursion depth, I set it to 4, try different values starging from 0, what will change in the picture? Here is my result with reflections and a recursion depth of 4:

# Step 8: refractions

If we know to do reflections, refractions are easy. We need to add one function to compute the refracted ray (using Snell's law), and three more lines of code in our recursive function cast_ray. Here is the result where the closest ball is "made of glass", it reflects and refracts the light at the same time:

# Steo 9: beyond the spheres

Till this moment we rendered only spheres because it is one of the simplest nontrivial mathematical objects. Let us add a plane. The chessboard is a classic choice. For this purpose, it is quite enough to add a dozen lines.

And here is the result:

As promised, the code has 256 lines of code, check it for yourself!

# Step 10: home assignment

We've come a long way: we've learned how to add objects to a scene, how to compute rather complicated lighting. Let me leave you two assignments as homework. Absolutely all the preparatory work has already been done in the branch homework_assignment. Each assignment will require ten lines of code tops.

### Assignment 1: environment map

At the moment, if the ray does not intersect any object, we just set the pixel to the constant background color. And why, actually, is it constant? Let's take a spherical photo (file envmap.jpg) and use it as a background! To make life easier, I linked our project with the stb library for the convenience of working with the jpg format. It should give us such an image:

### Assignment 2: quack-quack!

We can render both spheres and planes (see the checkerboard). So let's draw triangle meshes! I've written a code that allows you to read an .obj file, and I've added a ray-triangle intersection function to it. Now adding the duck to our scene should be quite trivial:

# Conclusion

My main goal is to show projects that are interesting (and easy!) to program. I am convinced that to become a good programmer one must do lots of side projects. I don't know about you, but I personally am not attracted to accounting software and the minesweeper game, even if the complexity of the code is quite comparable.

Few hours and two hundred and fifty lines of code give us a raytracer. Five hundred lines of the software rasterizer can be done in a few days. Graphics is really cool for learning the programming!

Support the author
Share post
AdBlock has stolen the banner, but banners are not teeth — they will be back

0
То ли я подключен на обе версии сайта (RUS/EN), то ли пост не в той языковой категори
0
fixed
0

Я тоже увидел, причем это первый пост на английском, который я вижу на Хабре. Походу не исправлено :)
Am I supposed to write comments in English here? ^^

–1
Скрытый текст

+3

Очень здорово, что вы пишете эти статьи. Еще не дочитал ее до конца — надо это делать в обнимку с IDE. Просто хотел выразить благодарность. У вас все статьи шикарные!


text:
## Calculus (3rd Edition)

$f(x)=[x]$ has a jump discontinuity at $x=n$.
The function $f(x)=[x]$, has a jump discontinuity at $x=n$ for every integer $n$, since $$\lim _{x \rightarrow n+}[x]=n, \quad \lim _{x \rightarrow n-}[x]=n-1.$$ Moreover, $f(x)=[x]$ is right-continuous, but not left continuous.


text:
# Pseudospectra in R implementation

Pseudospectra are typically computed by establishing a grid with $$N$$ points on a region of the complex plane, computing the resolvent norm $$||(zI − A)^{−1}||$$ at each grid point z, and visualizing with a contour plotter. Letting $$\sigma_{max}(·)$$ and $$\sigma_{min}(·)$$ denote the largest and smallest singular values of an input matrix, respectively, we remark that the resolvent norm satisfies

$$||(zI − A)^{−1}||_{2} =\sigma_{max}( (zI − A)^{−1})= \frac{1}{\sigma_{min}(zI − A)}$$ Thus, one could naively compute pseudospectra by computing the SVD of $$zI−A$$ for each grid point $$z$$ and reporting the reciprocal of the smallest singular value. Doing so in R I have a problem for implement it.

B = matrix(c(6, 6,
-1, 1),2,2,byrow = TRUE);B
I = diag(2)
resolution = 10^(-5)
z = seq(-4,0,by=resolution);z
min(svd(z*I - B)$d)  Any help? ## 1 Answer If you want to compute the minimum singular value for each $$z$$, you need to compute the SVD for each $$z$$, with a loop. For instance: sapply( z, function(u) min(svd(u*I - B)$d) )

Unless you know the eigenvalues are real (as in your example), you may prefer a grid in the complex plane.

xs <- seq(2.5,4.5,.01)
ys <- seq(-.5,.5,.01)
zs <- expand.grid( xs, ys )
zs <- apply( zs, 1, function(u) u[1] + 1i * u[2] )
S <- sapply( zs, function(z) min(svd(z*I - B)$d) ) S <- matrix( S, nr = length(xs), nc = length(ys) ) image( xs, ys, S ) contour( xs, ys, S, add = TRUE )  • If I don't know the eigen values if they are real?Maybe$B+B^{T}/2\$ – Tsiantakis Mar 31 at 5:45
• > image( xs, ys ) Error in image.default(xs, ys) : argument must be matrix-like > contour( xs, ys, S, add = TRUE ) Error in contour.default(xs, ys, S, add = TRUE) : plot.new has not been called yet – Tsiantakis Mar 31 at 5:49
• @Tsiantakis: this is fixed -- I had forgotten one argument. – VDZ Mar 31 at 7:43
• If you do not know the eigenvalues are real, and if you really want that matrix, you can use a grid in the complex plane (as in my example, and as in your textual description) instead of one on the real line (as in your initial code). Making the matrix symmetric also makes the eigenvalues real, but it is a different matrix. – VDZ Mar 31 at 7:45


text:
§34.14 Tables

Tables of exact values of the squares of the and symbols in which all parameters are are given in Rotenberg et al. (1959), together with a bibliography of earlier tables of , and symbols on pp. 33–36.

Tables of and symbols in which all parameters are are given in Appel (1968) to 6D. Some selected symbols are also given. Other tabulations for symbols are listed on pp. 11-12; for symbols on pp. 16-17; for symbols on p. 21.

Biedenharn and Louck (1981) give tables of algebraic expressions for Clebsch–Gordan coefficients and symbols, together with a bibliography of tables produced prior to 1975. In Varshalovich et al. (1988) algebraic expressions for the Clebsch–Gordan coefficients with all parameters and numerical values for all parameters are given on pp. 270–289; similar tables for the symbols are given on pp. 310–332, and for the symbols on pp. 359, 360, 372–411. Earlier tables are listed on p. 513.