Berawal dari status kawan di facebook tentang tantangan kecil di hackerrank 2 minggu yang lalu. Akhirnya saya ikutan mencoba membuat program sederhana dengan python. Sebetulnya hanya iseng saja di sela-sela menulis.
Persoalannya adalah diberikan dua buah angka yaitu K dan N. Hal yang ditanyakan adalah 2 angka terakhir dari deret S = 1^N + 2^N + … + K^N
Continue reading ‘dua angka terakhir pemangkatan bilangan bulat’
Filed under: programming | 1 Comment
Tag:hackerrank, power-function, python
Introduction to Look-up tables
Back in the DOS era and 80×86 CPU (I guess it’s quite old), mathematical operations for 3D Graphics were too expensive. One of the tricks to speed-up the graphics pipeline was using a pre-computed trigonometric functions implemented in a table. The benefit of using discretization of function parameter is measured by how complex the computation of function relative to accessing a table using a discretized input parameter. This method of replacing function call into looking up a table for already computed values are generally called Memoization.
Generalizing Look-up table for higher dimension
In previous example(trigonometric function) the input parameter is only one. If we think the parameter as a dimension, then the domain of the input parameter is a one dimensional object (a line). Of course the memoization technique is not only limited to one dimensional look-up table but can also be generalized to higher dimensions. In 3D Graphics (again), The memoization for higher dimension is used in texture mapping (2D) or voxel(volume pixel) representation for object modeling.
Grid shift: LUT in Coordinate transformation
Now let’s move from 3D Graphics to another area. In Geospatial domain, the same technique (look-up table) is used to transform coordinate from one Coordinate Reference System (CRS) to another CRS. Since most geographical coordinates only has two horizontal components (latitude and longitude). The look-up table is in the form of a two-dimensional grid. This grid-based transformation is also known as ‘Grid Shifts’.
Continue reading ‘Grid Shifts for Coordinate Transformation’
Filed under: c++, programming | Leave a Comment
Tag:coordinate transformation, gdal, grid shift, gsoc2014, ntv2, ogr, proj4
It’s been quite a while since my last post about Google Summer of code activities. I was trying to understand the inner working of the library which I use and gathering deeper knowledge about spatial coordinate and mapping. As I may previously mentioned in earlier post, I am working with GDAL and PROJ.4 Library. GDAL/OGR is mainly used for supporting many raster/vector format and also dealing with WKT (Well Known Text) representation of coordinate system. The Coordinate system is defined in WKT Format although in the GDAL/OGR Library, the main coordinate system transformation is done in the PROJ.4 library which is wrapped through an interface which consists of OGRSpatialReference and OGRCoordinateTransformation.
Continue reading ‘GSoC 2013 so far : pre mid-term Evaluation’
Filed under: c++, programming, work | 1 Comment