Skip to content

Instantly share code, notes, and snippets.

View mariusz's full-sized avatar
🤖
[ computing ]

Mariusz Cieśla mariusz

🤖
[ computing ]
View GitHub Profile
void pictureBox2_MouseClick(object sender, MouseEventArgs e)
{
Bitmap bmp = new Bitmap(this.pictureBox2.Image);
Color color = bmp.GetPixel(e.X, e.Y);
Bitmap message = new Bitmap(400, 30);
Graphics gr = Graphics.FromImage(message);
gr.Clear(Color.Black);
if (!(color.B == 0 && color.G == 0 && color.R == 0))
{
public void AddGrid()
{
this.Picture = new Bitmap(this.pictureBox2.Image);
double scaleX = 1.0;
double scaleY = 1.0;
if (this.OrginalSizeX > this.OrginalSizeY)
{
scaleY = this.OrginalSizeY / this.OrginalSizeX;
private void CreateModel()
{
if (mesh != null)
{
NormalizeMesh();
this.model = GL.glGenLists(1);
GL.glNewList(this.model, GL.GL_COMPILE_AND_EXECUTE);
for (int i = 0; i < mesh.Length - 1; i++)
{
private void NormalizeMesh()
{
double scaleX = 1.0;
double scaleY = 1.0;
if (this.sizeX > this.sizeY)
{
scaleY = this.sizeY / this.sizeX;
}
private double NormalizedValue(double value, double max, double min)
{
return (value - min) / (max - min);
}
protected override void InitGLContext()
{
GL.CSGLInit();
GL.glEnable(GL.GL_TEXTURE_2D); // Enable Texture Mapping
GL.glShadeModel(GL.GL_SMOOTH); // Enable Smooth Shading
GL.glClearColor(0.0f, 0.0f, 0.0f, 0.5f); // Black Background
GL.glClearDepth(1.0f); // Depth Buffer Setup
GL.glEnable(GL.GL_DEPTH_TEST); // Enables Depth Testing
GL.glDepthFunc(GL.GL_LEQUAL); // The Type Of Depth Testing To Do
Postprocesor.Chart chart = new Postprocesor.Chart();
chart.Mesh = points;
chart.SizeX = input.Width;
chart.SizeY = input.Height;
chart.ShowDialog();
StreamReader reader = new StreamReader("input.xml", Encoding.UTF8);
string content = reader.ReadToEnd().Remove(0, 1);
reader.Close();
InputData input = Serializer.Deserialize<InputData>(content);
Area area = new Area(input.Width, input.Height, input.DivX, input.DivY, input.K);
double[][] globalMatrixH = area.GlobalMatrixH;
double[][] h = GaussElimination.ExtendMatrix(globalMatrixH);
double[][] secondConditionAdded = h;
public static double[][] SecondKindBoundry(double[][] matrixH, Side side, Area area, double q)
{
List<CustomPoint> points = new List<CustomPoint>();
switch (side)
{
case Side.Dó³:
points = area.FirstRow;
break;
case Side.Lewa:
public static List<CustomPoint> GetPointsBySide(Side side, Area area)
{
List<CustomPoint> points = new List<CustomPoint>();
switch (side)
{
default:
case Side.Dó³:
points = area.FirstRow;
break;